This commit is contained in:
nusquama
2026-01-14 16:16:26 +08:00
parent 29b79f7166
commit bc2caf5048
@@ -0,0 +1,532 @@
Generate pain-driven content ideas from market signals with GPT-4o, Xpoz MCP, Google Sheets, ClickUp, and Slack
https://n8nworkflows.xyz/workflows/generate-pain-driven-content-ideas-from-market-signals-with-gpt-4o--xpoz-mcp--google-sheets--clickup--and-slack-12497
# Generate pain-driven content ideas from market signals with GPT-4o, Xpoz MCP, Google Sheets, ClickUp, and Slack
## 1. Workflow Overview
**Purpose:**
This workflow runs on a schedule to discover *real, pain-driven market signals* (frustrations, complaints, recurring questions) about a defined niche (here: **n8n automations** + **lead gen/CRM automation**). It uses GPT4o + an MCP social/search connector (Xpoz MCP) to extract raw pain points from public discussions, converts them into **creator-ready content ideas**, stores them in **Google Sheets**, creates **ClickUp tasks**, and posts a **Slack summary**. It also includes a dedicated **error alerting path via Gmail**.
**Target use cases:**
- Ongoing content ideation from real market conversations (B2B SaaS, automation, ops, growth).
- Keeping a marketing team supplied with hooks/angles grounded in authentic user language.
- Building an ops pipeline: ideation → database → task creation → team notification.
### 1.1 Scheduling & Input Injection
Runs on a schedule and injects the niche + keyword query to drive consistent research scope.
### 1.2 Raw Market Discovery (Public Signals)
Uses an AI Agent with:
- **GPT4o** as the language model
- **Xpoz MCP** as an external tool for public search/social intelligence
to produce *non-JSON* bullet insights of user pain points and language.
### 1.3 Content Ideation (Structured)
A second AI Agent converts the raw discovery into **JSON-only content ideas** (hook, platform, format, pain point, resonance, CTA).
### 1.4 Output Normalization
A Code node removes markdown fences, parses JSON, enforces array output, and normalizes field names across possible model output variants.
### 1.5 Storage, Task Creation, Aggregation & Slack Notification
Each idea is:
- appended to **Google Sheets** (content database),
- turned into a **ClickUp task**, then
- aggregated to generate a short **Slack summary** via GPT4o and posted to a channel.
### 1.6 Error Handling
On any workflow error, the **Error Trigger** sends a Gmail alert containing the failing node name and the error message.
---
## 2. Block-by-Block Analysis
### Block 1 — Scheduling & Research Inputs
**Overview:**
Starts the workflow periodically and defines the niche/query parameters used by the downstream discovery prompt.
**Nodes involved:**
- Scheduled Market Discovery Trigger
- Inject Niche and Keyword Parameters
#### Node: Scheduled Market Discovery Trigger
- **Type / role:** `scheduleTrigger` — entry point; launches executions on a schedule.
- **Configuration (interpreted):** Interval schedule is enabled but not explicitly detailed in the exported JSON (`interval: [{}]`). In n8n UI, this typically means the schedule must be configured (e.g., every day/hour).
- **Outputs:** Sends one item into the flow.
- **Connections:** → Inject Niche and Keyword Parameters
- **Edge cases / failures:**
- Misconfigured schedule can result in never firing or firing too often.
- Timezone considerations: schedule uses instance timezone settings.
#### Node: Inject Niche and Keyword Parameters
- **Type / role:** `set` — injects constants for the prompts.
- **Configuration:**
- Sets `body.niche = "n8n automations"`
- Sets `body.query = "lead generation and CRM automation using n8n"`
- **Key variables:** Uses expressions with string literals (`=...`).
- **Connections:** ← Scheduled Market Discovery Trigger; → Extract Raw User Pain Points…
- **Edge cases / failures:**
- If you later change prompt expectations and forget to update these fields, downstream prompts may be mismatched.
- Naming uses `body.*`; ensure downstream nodes reference the same path.
**Sticky note covering this block:**
- “## Scheduling & Research Inputs
Controls when discovery runs and defines the niche and keyword focus.”
---
### Block 2 — Raw Market Discovery (Public Signals)
**Overview:**
An AI Agent uses GPT4o plus a connected MCP tool (Xpoz) to scan public discussions and return raw bullet insights (explicitly **not JSON**).
**Nodes involved:**
- Extract Raw User Pain Points from Public Discussions (AI)
- OpenAI Reasoning Engine for Market Discovery
- Public Search & Social Intelligence Connector (MCP)
#### Node: OpenAI Reasoning Engine for Market Discovery
- **Type / role:** `lmChatOpenAi` — provides GPT4o as the agents language model.
- **Configuration:**
- Model: `gpt-4o`
- Responses API disabled (`responsesApiEnabled: false`)
- **Credentials:** OpenAI (`OpenAi account 2`)
- **Connections:** Outputs via `ai_languageModel` → Extract Raw User Pain Points…
- **Edge cases / failures:**
- Auth/quota errors (401/429), model availability changes, latency/timeouts.
- Output variability: even with instructions, the model may add headings or extra text.
#### Node: Public Search & Social Intelligence Connector (MCP)
- **Type / role:** `mcpClientTool` — tool connector for the agent (retrieval/search across platforms).
- **Configuration:**
- Endpoint: `https://mcp.xpoz.ai/mcp`
- Auth: Bearer token
- **Credentials:** HTTP Bearer Auth (`saurabh xpoz`)
- **Connections:** Outputs via `ai_tool` → Extract Raw User Pain Points…
- **Edge cases / failures:**
- MCP endpoint downtime, auth failure, rate limits.
- Tool output schema changes can degrade the agents effectiveness.
#### Node: Extract Raw User Pain Points from Public Discussions (AI)
- **Type / role:** `langchain.agent` — orchestrates tool use + LLM to produce discovery notes.
- **Configuration choices:**
- Prompt includes:
- Niche: `{{ $json.body.niche }}`
- Keywords: `{{ $json.body.query }}`
- Instructions: scan public discussions, extract repeated pain points/questions/frustrations, user language, tool mentions; **no solutions**; **no JSON**.
- System message enforces neutrality, public info only, no solutions, no JSON, no conclusions.
- `maxIterations: 30` (agent can loop tool calls/thought steps up to this limit).
- `hasOutputParser: true` (agent node expects structured handling internally; final output is still plain text in `output`).
- **Inputs:** Receives the `body.*` fields from the Set node; also receives tool + LLM from the two connected AI ports.
- **Outputs:** Produces `item.json.output` containing the raw discovery text.
- **Connections:** → Generate Pain-Driven Content Ideas…
- **Edge cases / failures:**
- Tool returns irrelevant data → agent output drifts.
- Agent may still output semi-structured lists with markdown, which is fine for the next step.
- Iteration limit reached → partial output or failure depending on node behavior.
**Sticky note covering this block:**
- “## Raw Market Discovery
Extracts real user pain points and language from public discussions.”
---
### Block 3 — Content Ideation (Structured JSON)
**Overview:**
A second AI Agent transforms the raw discovery output into **content ideas** and must return **ONLY valid JSON**.
**Nodes involved:**
- Generate Pain-Driven Content Ideas from Market Signals (AI)
- OpenAI Reasoning Engine for Content Ideation
#### Node: OpenAI Reasoning Engine for Content Ideation
- **Type / role:** `lmChatOpenAi` — GPT4o model for ideation agent.
- **Configuration:**
- Model: `gpt-4o`
- Responses API disabled
- **Credentials:** OpenAI (`OpenAi account 2`)
- **Connections:** `ai_languageModel` → Generate Pain-Driven Content Ideas…
- **Edge cases / failures:**
- Same OpenAI risks: quota/rate limits, timeouts, output variability.
#### Node: Generate Pain-Driven Content Ideas from Market Signals (AI)
- **Type / role:** `langchain.agent` — generates structured ideas.
- **Configuration choices:**
- Prompt injects raw discovery: `{{ $json.output }}`
- Requires per idea:
- hook, best platform, format, pain point, resonance reason, CTA
- Strong constraints: avoid generic advice/tutorial tone; “Return ONLY valid JSON”.
- System message frames the model as senior content strategist; demands creator-ready, no fluff.
- `maxIterations: 30` (agent can iterate; though no tool is attached here—only the LLM).
- **Input:** From discovery agent output.
- **Output:** Expects `item.json.output` to be JSON text (string).
- **Connections:** → Normalize and Parse Content Ideas Output
- **Edge cases / failures:**
- Model returns markdown code fences (common) — handled by the next Code node.
- Model returns an object instead of an array — Code node will throw.
- Invalid JSON due to trailing commas/quotes — Code node will throw.
**Sticky note covering this block:**
- “## Content Ideation
Converts real pain points into platform-ready content ideas.”
---
### Block 4 — Output Normalization
**Overview:**
Cleans the ideation output, parses JSON safely, validates its an array, and normalizes fields to a consistent schema for downstream storage/tools.
**Nodes involved:**
- Normalize and Parse Content Ideas Output
#### Node: Normalize and Parse Content Ideas Output
- **Type / role:** `code` — parsing/validation/normalization.
- **Configuration (logic interpreted):**
1. Takes first incoming item: `$input.first()`
2. Ensures `item.json.output` exists; else throws “Missing AI output”.
3. Strips markdown fences ```json / ``` from the raw string.
4. `JSON.parse(raw)`; on failure throws “Failed to parse…”.
5. Ensures the parsed result is an **array**; else throws.
6. Normalizes each array element:
- Supports “new format” where each item may be nested under `content_idea`.
- Maps multiple possible key variants to standard keys:
- `platform` from `platform` or `best_platform`
- `content_format` from `format` or `content_format`
- `content_hook` from `hook` or `content_hook`
- `pain_point` from `pain_point` or `core_pain_point_addressed`
- `why_it_resonates` from `reason_resonate` or `why_this_content_will_resonate`
- `cta` from `cta` or `suggested_CTA`
- Adds defaults (“Unknown”, “Post”, or empty string)
7. Returns one n8n item per content idea.
- **Connections:** Fan-out to three nodes:
- → Append Content Ideas to Content Database (Google Sheets)
- → Create Content Task in ClickUp
- → Aggregate Generated Content Ideas
- **Edge cases / failures:**
- If the AI returns a top-level object like `{ ideas: [...] }`, this will fail (not an array).
- If the AI returns comments or trailing text after JSON, parse fails.
- If the AI returns very large JSON arrays, downstream API rate limits may occur (Sheets/ClickUp).
**Sticky note covering this block:**
- “## Output Normalization
Cleans and standardizes AI-generated content ideas.”
---
### Block 5 — Content Storage & Task Creation
**Overview:**
Persists each normalized content idea to Google Sheets and creates a corresponding ClickUp task for execution.
**Nodes involved:**
- Append Content Ideas to Content Database
- Create Content Task in ClickUp
#### Node: Append Content Ideas to Content Database
- **Type / role:** `googleSheets` — appends rows into a spreadsheet tab (“content database”).
- **Configuration:**
- Operation: **Append**
- Document: Spreadsheet ID `17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM`
- Sheet/tab: GID `869555007` (“content database”)
- Column mapping (from normalized fields):
- Platform, Content Format, Content Hook, Pain Point, Why It Resonates, CTA
- Status: hardcoded `"New"`
- Created At: `{{$now}}`
- **Credentials:** Google Sheets OAuth2 (`automations@techdome.ai`)
- **Inputs:** One item per content idea.
- **Outputs:** Appended-row result(s) from Google Sheets (not used downstream directly).
- **Edge cases / failures:**
- Sheet renamed or columns changed → append may fail or write to wrong columns.
- OAuth token expiry / missing permissions.
- Rate limiting if many ideas are generated at once.
#### Node: Create Content Task in ClickUp
- **Type / role:** `clickUp` — creates a task per idea.
- **Configuration:**
- Team: `9014872066`
- Space: `90143686913`
- Folder: `90147011966`
- List: `901412736351`
- Task name: `{{$json.content_hook}}`
- Status: `"to do"`
- Task content/body concatenates: platform, format, pain point, why it resonates, CTA
- **Credentials:** ClickUp API (`ClickUp account 3`)
- **Inputs:** One item per content idea.
- **Outputs:** Created task data (not used further).
- **Edge cases / failures:**
- Invalid list/team IDs, or status name mismatch (“to do” must exist in the list).
- Rate limits on ClickUp when many tasks are created.
- Task name too long (content_hook can be lengthy) → consider truncation.
**Sticky note covering this block:**
- “## Content Storage & Task Creation
Stores ideas and creates execution tasks for the content team.”
---
### Block 6 — Aggregation & Team Notification
**Overview:**
Aggregates all generated ideas, uses GPT4o to produce a skimmable Slack summary (count, platforms, top hooks), and posts it to a Slack channel.
**Nodes involved:**
- Aggregate Generated Content Ideas
- Generate Slack Summary of Content Ideas
- OpenAI Reasoning Engine for Slack Summary
- Send Content Ideation Summary to Slack Channel
#### Node: Aggregate Generated Content Ideas
- **Type / role:** `aggregate` — merges multiple idea items into one payload for summarization.
- **Configuration:**
- Mode: aggregate all item data (`aggregateAllItemData`)
- **Inputs:** Multiple items (one per idea) from normalization.
- **Outputs:** A single aggregated item passed to the Slack-summary agent.
- **Edge cases / failures:**
- If upstream generates zero ideas, aggregation behavior may produce empty arrays; summary agent must handle it (it likely will, but not guaranteed).
#### Node: OpenAI Reasoning Engine for Slack Summary
- **Type / role:** `lmChatOpenAi` — GPT4o for summarization.
- **Configuration:** Model `gpt-4o`
- **Credentials:** OpenAI (`OpenAi account 2`)
- **Connections:** `ai_languageModel` → Generate Slack Summary of Content Ideas
- **Edge cases:** quota/rate limits/timeouts.
#### Node: Generate Slack Summary of Content Ideas
- **Type / role:** `langchain.agent` — writes Slack message text.
- **Configuration:**
- Prompt uses: `{{ JSON.stringify($input.all().map(i => i.json), null, 2) }}`
- Note: because this node follows an Aggregate node, `$input.all()` may contain one aggregated item (depending on Aggregate output structure). If the Aggregate node outputs a single item containing an array, this prompt may not reflect the real list of ideas as intended.
- Requirements: short, skimmable, total count, platforms, top 3 hooks; “Return ONLY the Slack message text.”
- Allows light emoji use.
- **Outputs:** `item.json.output` containing Slack-ready text.
- **Connections:** → Send Content Ideation Summary to Slack Channel
- **Edge cases / failures:**
- If the prompt input doesnt include the full set of ideas (due to aggregation shape), the summary may be incomplete.
- The model might include extra formatting; Slack can handle basic formatting, but the next node posts raw text.
#### Node: Send Content Ideation Summary to Slack Channel
- **Type / role:** `slack` — posts a message to a channel.
- **Configuration:**
- Channel: `C09GNB90TED` (“general-information”)
- Text: `{{ $json.output }}`
- **Credentials:** Slack API (`Slack account vivek`)
- **Edge cases / failures:**
- Missing scopes (e.g., `chat:write`), channel not accessible, token revoked.
- Posting too frequently can hit Slack rate limits.
**Sticky note covering this block:**
- “## Aggregation & Team Notification
Summarizes content ideas and notifies the team in Slack.”
---
### Block 7 — Error Handling
**Overview:**
Any node failure triggers an alternate execution path that emails an alert with node name, error message, and timestamp.
**Nodes involved:**
- Workflow Error Handler
- Send a message1
#### Node: Workflow Error Handler
- **Type / role:** `errorTrigger` — secondary entry point fired on workflow errors.
- **Configuration:** Default; triggers when any node in the workflow errors.
- **Connections:** → Send a message1
- **Edge cases / failures:**
- If the error is caused by credential-wide outage, Gmail may also fail; consider adding Slack alert fallback.
#### Node: Send a message1
- **Type / role:** `gmail` — sends an email alert.
- **Configuration:**
- Subject: “Workflow Error Alert”
- Body includes:
- Error Node: `{{ $json.node.name }}`
- Error Message: `{{ $json.error.message }}`
- Timestamp: `{{ $now.toISO() }}`
- Email type: text
- **Credentials:** (Not shown in node, but required in n8n) Gmail OAuth2.
- **Edge cases / failures:**
- Gmail OAuth expired, missing permission to send.
- Message includes an emoji and Slack-like formatting; in plain text email it will still be readable.
**Sticky note covering this block:**
- “## Error Handling
Sends alerts when the workflow fails”
---
## 3. Summary Table
| Node Name | Node Type | Functional Role | Input Node(s) | Output Node(s) | Sticky Note |
|---|---|---|---|---|---|
| Scheduled Market Discovery Trigger | Schedule Trigger | Scheduled entry point | — | Inject Niche and Keyword Parameters | ## Scheduling & Research Inputs; Controls when discovery runs and defines the niche and keyword focus. |
| Inject Niche and Keyword Parameters | Set | Defines `body.niche` and `body.query` | Scheduled Market Discovery Trigger | Extract Raw User Pain Points from Public Discussions (AI) | ## Scheduling & Research Inputs; Controls when discovery runs and defines the niche and keyword focus. |
| Extract Raw User Pain Points from Public Discussions (AI) | LangChain Agent | Market discovery from public discussions using LLM + MCP tool | Inject Niche and Keyword Parameters; (AI) OpenAI Reasoning Engine for Market Discovery; (AI Tool) Public Search & Social Intelligence Connector (MCP) | Generate Pain-Driven Content Ideas from Market Signals (AI) | ## Raw Market Discovery; Extracts real user pain points and language from public discussions. |
| OpenAI Reasoning Engine for Market Discovery | OpenAI Chat Model (LangChain) | GPT4o model for discovery agent | — | Extract Raw User Pain Points from Public Discussions (AI) (ai_languageModel) | ## Raw Market Discovery; Extracts real user pain points and language from public discussions. |
| Public Search & Social Intelligence Connector (MCP) | MCP Client Tool | External search/social intelligence tool access | — | Extract Raw User Pain Points from Public Discussions (AI) (ai_tool) | ## Raw Market Discovery; Extracts real user pain points and language from public discussions. |
| Generate Pain-Driven Content Ideas from Market Signals (AI) | LangChain Agent | Converts raw discovery into JSON content ideas | Extract Raw User Pain Points from Public Discussions (AI); (AI) OpenAI Reasoning Engine for Content Ideation | Normalize and Parse Content Ideas Output | ## Content Ideation; Converts real pain points into platform-ready content ideas. |
| OpenAI Reasoning Engine for Content Ideation | OpenAI Chat Model (LangChain) | GPT4o model for ideation agent | — | Generate Pain-Driven Content Ideas from Market Signals (AI) (ai_languageModel) | ## Content Ideation; Converts real pain points into platform-ready content ideas. |
| Normalize and Parse Content Ideas Output | Code | Strips fences, parses JSON array, normalizes keys | Generate Pain-Driven Content Ideas from Market Signals (AI) | Append Content Ideas to Content Database; Create Content Task in ClickUp; Aggregate Generated Content Ideas | ## Output Normalization; Cleans and standardizes AI-generated content ideas. |
| Append Content Ideas to Content Database | Google Sheets | Appends each idea to a sheet (content DB) | Normalize and Parse Content Ideas Output | — | ## Content Storage & Task Creation; Stores ideas and creates execution tasks for the content team. |
| Create Content Task in ClickUp | ClickUp | Creates a task per idea | Normalize and Parse Content Ideas Output | — | ## Content Storage & Task Creation; Stores ideas and creates execution tasks for the content team. |
| Aggregate Generated Content Ideas | Aggregate | Aggregates all idea items for summarization | Normalize and Parse Content Ideas Output | Generate Slack Summary of Content Ideas | ## Aggregation & Team Notification; Summarizes content ideas and notifies the team in Slack. |
| Generate Slack Summary of Content Ideas | LangChain Agent | Produces Slack-ready summary text | Aggregate Generated Content Ideas; (AI) OpenAI Reasoning Engine for Slack Summary | Send Content Ideation Summary to Slack Channel | ## Aggregation & Team Notification; Summarizes content ideas and notifies the team in Slack. |
| OpenAI Reasoning Engine for Slack Summary | OpenAI Chat Model (LangChain) | GPT4o model for Slack summarizer | — | Generate Slack Summary of Content Ideas (ai_languageModel) | ## Aggregation & Team Notification; Summarizes content ideas and notifies the team in Slack. |
| Send Content Ideation Summary to Slack Channel | Slack | Posts summary to Slack channel | Generate Slack Summary of Content Ideas | — | ## Aggregation & Team Notification; Summarizes content ideas and notifies the team in Slack. |
| Workflow Error Handler | Error Trigger | Catches workflow errors | — | Send a message1 | ## Error Handling; Sends alerts when the workflow fails |
| Send a message1 | Gmail | Emails error alert | Workflow Error Handler | — | ## Error Handling; Sends alerts when the workflow fails |
| Sticky Note | Sticky Note | Header/workflow explanation | — | — | ## 📣 Generate Pain-Driven Content Ideas from Market Signals using GPT-4o, XPOZ MCP, ClickUp, and Google Sheets; How it works + Setup steps. |
| Sticky Note1 | Sticky Note | Comment block | — | — | ## Scheduling & Research Inputs; Controls when discovery runs and defines the niche and keyword focus. |
| Sticky Note2 | Sticky Note | Comment block | — | — | ## Raw Market Discovery; Extracts real user pain points and language from public discussions. |
| Sticky Note3 | Sticky Note | Comment block | — | — | ## Content Ideation; Converts real pain points into platform-ready content ideas. |
| Sticky Note4 | Sticky Note | Comment block | — | — | ## Output Normalization; Cleans and standardizes AI-generated content ideas. |
| Sticky Note5 | Sticky Note | Comment block | — | — | ## Content Storage & Task Creation; Stores ideas and creates execution tasks for the content team. |
| Sticky Note6 | Sticky Note | Comment block | — | — | ## Aggregation & Team Notification; Summarizes content ideas and notifies the team in Slack. |
| Sticky Note7 | Sticky Note | Comment block | — | — | ## Error Handling; Sends alerts when the workflow fails |
---
## 4. Reproducing the Workflow from Scratch
1. **Create a new workflow** in n8n
- Name it: *Generate pain-driven content ideas from market signals using AI* (or your preferred name).
- Ensure workflow **Settings → Execution Order** is set to **v1** (to match the export).
2. **Add Schedule Trigger**
- Node: **Schedule Trigger**
- Configure the cadence (e.g., daily, hourly).
- Connect it to the next node.
3. **Add Set node for inputs**
- Node: **Set**
- Add fields:
- `body.niche` (String) = `n8n automations`
- `body.query` (String) = `lead generation and CRM automation using n8n`
- Connect: Schedule Trigger → Set
4. **Add MCP tool connector (Xpoz MCP)**
- Node: **MCP Client Tool** (LangChain)
- Endpoint URL: `https://mcp.xpoz.ai/mcp`
- Authentication: **Bearer Auth**
- Create credential: **HTTP Bearer Auth**
- Paste your Xpoz MCP token.
- This node will be connected to the discovery agent via the **ai_tool** port.
5. **Add OpenAI Chat Model (for discovery)**
- Node: **OpenAI Chat Model** (LangChain `lmChatOpenAi`)
- Model: `gpt-4o`
- Create/OpenAI credential with your API key.
- Connect to discovery agent via **ai_languageModel** port.
6. **Add AI Agent for market discovery**
- Node: **AI Agent** (LangChain Agent)
- Prompt (Text) should:
- Reference `{{ $json.body.niche }}` and `{{ $json.body.query }}`
- Instruct: scan public discussions, extract pain points/questions/language, **no solutions**, **no JSON**
- Set **Max Iterations** to `30`.
- System message: enforce neutral discovery behavior and “no JSON”.
- Connections:
- Main: Set → Discovery Agent
- AI ports:
- OpenAI (discovery) → Discovery Agent (`ai_languageModel`)
- MCP Tool → Discovery Agent (`ai_tool`)
7. **Add OpenAI Chat Model (for ideation)**
- Node: **OpenAI Chat Model** (LangChain)
- Model: `gpt-4o`
- Use the same OpenAI credential (or a different one).
- Connect to ideation agent via **ai_languageModel**.
8. **Add AI Agent for content ideation**
- Node: **AI Agent**
- Prompt should:
- Inject discovery text via `{{ $json.output }}`
- Require: hook, platform, format, pain point, why it resonates, CTA
- Require: **Return ONLY valid JSON** (array of ideas)
- Set **Max Iterations** to `30`.
- Connect: Discovery Agent → Ideation Agent (main)
- Connect OpenAI ideation model to this agent via **ai_languageModel**.
9. **Add Code node to parse/normalize**
- Node: **Code**
- Paste logic that:
- Validates `item.json.output`
- Strips ```json fences
- Parses JSON, enforces array
- Normalizes keys to:
- `platform`, `content_format`, `content_hook`, `pain_point`, `why_it_resonates`, `cta`
- Connect: Ideation Agent → Code
10. **Add Google Sheets append node**
- Node: **Google Sheets**
- Credentials: Google Sheets OAuth2 (ensure access to the target spreadsheet).
- Operation: **Append**
- Select the spreadsheet and the sheet/tab (your “content database”).
- Map columns to fields from Code output:
- Platform ← `{{$json.platform}}`
- Content Format ← `{{$json.content_format}}`
- Content Hook ← `{{$json.content_hook}}`
- Pain Point ← `{{$json.pain_point}}`
- Why It Resonates ← `{{$json.why_it_resonates}}`
- CTA ← `{{$json.cta}}`
- Status ← `"New"`
- Created At ← `{{$now}}`
- Connect: Code → Google Sheets
11. **Add ClickUp create task node**
- Node: **ClickUp**
- Credentials: ClickUp API token/OAuth with access to the workspace.
- Operation: **Create Task**
- Configure Team/Space/Folder/List to your target list.
- Task name: `{{$json.content_hook}}`
- Additional fields:
- Status: `"to do"` (must exist in the list)
- Content/Description: include platform, format, pain point, why it resonates, CTA
- Connect: Code → ClickUp
12. **Add Aggregate node**
- Node: **Aggregate**
- Mode: **Aggregate All Item Data**
- Connect: Code → Aggregate
13. **Add OpenAI Chat Model (for Slack summary)**
- Node: **OpenAI Chat Model** (LangChain)
- Model: `gpt-4o`
- Connect to Slack summary agent via **ai_languageModel**.
14. **Add AI Agent to write Slack summary**
- Node: **AI Agent**
- Prompt: stringify incoming idea items; require total count, platforms, top 3 hooks; return **only message text**.
- Connect: Aggregate → Slack Summary Agent
- Connect OpenAI summary model → Slack Summary Agent (`ai_languageModel`)
15. **Add Slack node to post message**
- Node: **Slack**
- Credentials: Slack OAuth/token with `chat:write`.
- Operation: send message to channel
- Channel: pick your marketing/growth channel
- Text: `{{$json.output}}`
- Connect: Slack Summary Agent → Slack node
16. **Add error handling path**
- Node: **Error Trigger**
- Node: **Gmail** (send email)
- Subject: “Workflow Error Alert”
- Message body using:
- `{{ $json.node.name }}`
- `{{ $json.error.message }}`
- `{{ $now.toISO() }}`
- Connect: Error Trigger → Gmail
- Configure Gmail OAuth2 credentials.
17. **(Optional) Add Sticky Notes**
- Add note blocks for: Scheduling & Inputs, Raw Discovery, Content Ideation, Normalization, Storage/Tasks, Slack Notification, Error Handling.
---
## 5. General Notes & Resources
| Note Content | Context or Link |
|---|---|
| “## 📣 Generate Pain-Driven Content Ideas from Market Signals using GPT-4o, XPOZ MCP, ClickUp, and Google Sheets” | Workflow header sticky note (overview + setup steps) |
| Setup steps listed in the workflow note: schedule frequency; update niche/keywords; connect OpenAI; connect MCP (Xpoz); configure Google Sheets + ClickUp; select Slack channel | Embedded in the main sticky note |
| Disclaimer (provided by user): “Le texte fourni provient exclusivement…” | General compliance note (not tied to a node) |