탐색으로 건너뛰기

Build a Dify workflow that cites Xiaohongshu and WeChat sources

For a recurring editorial brief, use two HTTP Request nodes in a Dify workflow: one calls xiaohongshu.app_v2.search_notes to search Xiaohongshu notes, and the other calls wechat_mp.v2.fetch_account_articles to list articles from one WeChat official account. If a Dify Agent should choose the platform from the question, connect BeatAPI as an MCP server instead. For a first run, search for “coffee machine descaling” and pick a tutorial from a verified account.

Dify model setup · Read and verify an assistant’s sources

Configure the fixed HTTP workflow

  1. In the Workflow start node, add two string inputs: keyword (the Xiaohongshu search term) and account_username (a verified WeChat account identifier).
  2. Add two HTTP Request nodes that POST to https://api.beatapi.io/v1/social-data/call.
  3. Select Bearer authentication, store the BeatAPI key as a Secret environment variable, and reference the key through the variable picker.
  4. Set the body type to JSON, paste the matching body below, and replace each placeholder with the matching Dify variable.
{"action":"xiaohongshu.app_v2.search_notes","params":{"keyword":"<keyword>","page":1}}
{"action":"wechat_mp.v2.fetch_account_articles","params":{"username":"<account_username>","offset":"","item_show_type":0,"raw":false}}

Use If-Else to check the HTTP status. In a Code node, parse the response body if the body arrived as text, then check status, error and request_id. Xiaohongshu candidates are under data.data.items[].note. WeChat titles, links and summaries are under data.articles[]. Connect the status, the request ID and the candidates to Output. Keep a successful empty list as an empty list, and route failures to a separate output. Send only the selected links to the WeChat reader or the Xiaohongshu detail workflow when needed.

Check each source’s response separately before passing the results to the brief. To keep partial results in the same run, configure error handling on both HTTP nodes: when one source fails, return a failure status for the failed source and pass the other source’s candidates through. Keep the source, the input, the status, the candidates and the request ID together, so you can retry the exact keyword or account that failed.

What should the first debug run return?

What you see in the debug runWhat to do next
A Xiaohongshu note titled “My machine still smells after descaling”Keep the note ID, the returned title and the request ID. Use the note as a lead, then fetch the selected note before quoting specifics.
A WeChat list item titled “Steps for cleaning a coffee machine”Keep the item’s title, article link, summary and request ID. The brief can cite what the summary explicitly says. Read the article before listing the cleaning steps.
Xiaohongshu returns an empty list or the WeChat request failsReport a successful empty search as “No results in this run.” Report the failed lookup separately with its request ID when available. Retry WeChat on its own.

An LLM prompt can ask: “Suggest up to two topics. For each one, include the source identifier and something the editor should verify. Label any material that consists of a title or summary.” Before handing off the brief, open one source and verify the corresponding statement. One keyword page plus one account page takes two data requests; every selected detail takes an additional request.

Use MCP if the Agent should select the tool

Under Tools → MCP → Add MCP Server, enter https://beatapi.io/mcp and choose Streamable HTTP. If your connection settings support custom authentication headers, pass Authorization: Bearer <BEATAPI_API_KEY> through protected configuration. If your Dify version offers no compatible authentication, use the HTTP workflow above.

  1. Check that capabilities_search, capabilities_inspect and capabilities_run appear, then attach the three tools to the Agent or use them as separate tool nodes in order.
  2. Search for the Xiaohongshu keyword-search capability or the WeChat account-list capability.
  3. Inspect the returned reference and the required inputs.
  4. Run the capability for one target.

In the execution log, match the input, the request ID and the returned records to the workflow output. Label WeChat list previews as summaries. See BeatAPI pricing.

Dify HTTP Request · Dify MCP tools