People Also Ask data is useful for content research, but raw questions are not ready to use by default.
If you pass the entire SERP response into a Dify LLM node, the prompt gets noisy fast. A better workflow is to call a SERP API, extract only the people_also_ask field, clean it, deduplicate it, and pass a compact question list into the next node.
This walkthrough shows a simple Dify workflow pattern using TalorData SERP API as the search data source.
Workflow shape
The workflow has four steps:
- Start node: accepts a keyword or topic.
- HTTP Request node: calls the SERP API.
- Code node: extracts and deduplicates People Also Ask questions.
- LLM node: groups the questions into content angles or brief inputs.
The important part is the middle layer. Do not make the LLM parse a full SERP response if you only need questions.
Step 1: Create the input
Create a workflow input variable:
query
Example input:
serp api pricing
Keep the first version to one query. Multi-query workflows are easier after the response shape is stable.
Step 2: Add the HTTP Request node
Use a POST request.
URL:
https://serpapi.talordata.net/serp/v1/request
Headers:
Authorization: Bearer <TALORDATA_TOKEN>
Content-Type: application/x-www-form-urlencoded
Body parameters:
engine=google
q={{ query }}
json=2
If your Dify workspace uses a different variable reference format, adapt the q value to the variable syntax shown in your workflow editor.
Step 3: Inspect the field you need
The field to inspect is:
people_also_ask
For this workflow, the rest of the SERP response is secondary. You may keep organic results for later context, but the first parser should focus on questions.
A clean intermediate result can look like this:
[
{ "question": "What is a SERP API?" },
{ "question": "How do I use Google Search data in an AI workflow?" }
]
Step 4: Deduplicate questions
People Also Ask questions can be repetitive. Some differ only by casing, punctuation, or small wording changes.
In a Code node, normalize the question before deduplication:
const paa = $json.people_also_ask || [];
const seen = new Set();
const questions = [];
for (const item of paa) {
const raw = item.question || item.title || "";
const question = raw.trim();
if (!question) continue;
const key = question
.toLowerCase()
.replace(/[?!.]/g, "")
.replace(/\s+/g, " ");
if (seen.has(key)) continue;
seen.add(key);
questions.push({ question });
}
return [
{
json: {
query: $json.request_params?.q,
questions,
question_count: questions.length,
},
},
];
This gives the LLM a compact list instead of a full API response.
Step 5: Ask the LLM to group, not invent
The next LLM node should transform the extracted questions. It should not invent a new list from scratch.
A prompt can be simple:
You are helping create a content brief from real People Also Ask questions.
Input:
{{ questions }}
Group these questions into 3-5 search-intent clusters. Keep the original questions visible under each cluster. Do not add questions that are not present in the input.
This keeps the workflow grounded in the PAA data.
Step 6: Return a useful output
A practical output format:
Topic: SERP API pricing
Cluster 1: API basics
- What is a SERP API?
- How does a SERP API work?
Cluster 2: Use cases
- How do AI agents use search data?
- How can SEO teams automate SERP monitoring?
Cluster 3: Evaluation
- What should I compare when choosing a SERP API?
That output is easier to turn into a brief than a raw list of questions.
What to log
During testing, log:
- input query
- response timestamp if available
- number of PAA items returned
- number of deduplicated questions
- final grouped clusters
If a brief looks weak, you can inspect whether the issue came from the query, the SERP response, the parser, or the LLM grouping step.
Final thought
A Dify workflow does not need to hand the entire SERP response to an LLM. For content research, it is often better to extract one useful field, shape it carefully, and then let the LLM organize it.
If you want to test this with live search data, new TalorData accounts include 500 responses for a small Dify PAA workflow.
Top comments (0)