Perplexity to Contentful, knowledge base articles ready
Your knowledge base shouldn’t feel like a second job. But it often does: messy drafts, missing metadata, “we’ll add sources later,” and a backlog that never shrinks.
This Perplexity Contentful integration hits Marketing Managers trying to publish support-friendly content fast. It also saves Ops leads who hate process debt and agency teams shipping content for clients. The outcome is simple: one prompt becomes a structured, source-backed article that’s ready to publish in Contentful.
Below you’ll see what the workflow automates, where the time savings come from, and what you’ll need to get it live without turning this into a weeks-long “content system” project.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: Perplexity to Contentful, knowledge base articles ready
flowchart LR
subgraph sg0["When chat message received Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Create Perplexity Content"]
n1@{ icon: "mdi:robot", form: "rounded", label: "AI Writer Agent", pos: "b", h: 48 }
n2@{ icon: "mdi:robot", form: "rounded", label: "AI Editor Agent", pos: "b", h: 48 }
n3@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n4@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model1", pos: "b", h: 48 }
n5@{ icon: "mdi:wrench", form: "rounded", label: "Accept and Publish", pos: "b", h: 48 }
n6@{ icon: "mdi:play-circle", form: "rounded", label: "When chat message received", pos: "b", h: 48 }
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>JSON.parse1"]
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge"]
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Format"]
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>JSON.parse"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Format Perplexity Output & A.."]
n12@{ icon: "mdi:swap-vertical", form: "rounded", label: "Initialize Count", pos: "b", h: 48 }
n13@{ icon: "mdi:code-braces", form: "rounded", label: "Increment Count", pos: "b", h: 48 }
n14@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check Limit", pos: "b", h: 48 }
n15@{ icon: "mdi:cog", form: "rounded", label: "Stop Here", pos: "b", h: 48 }
n16@{ icon: "mdi:cog", form: "rounded", label: "Execute Workflow", pos: "b", h: 48 }
n17["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>JSON.parse3"]
n18@{ icon: "mdi:swap-horizontal", form: "rounded", label: "should submit", pos: "b", h: 48 }
n8 --> n9
n9 --> n2
n15 --> n17
n10 --> n1
n10 --> n13
n14 --> n15
n14 --> n18
n7 --> n8
n17 --> n16
n18 --> n17
n18 --> n10
n2 --> n14
n1 --> n0
n1 --> n7
n13 --> n8
n12 --> n1
n12 --> n13
n3 -.-> n1
n5 -.-> n2
n4 -.-> n2
n0 --> n11
n6 --> n12
n11 --> n8
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n6 trigger
class n1,n2 ai
class n3,n4 aiModel
class n5 ai
class n14,n18 decision
class n0 api
class n7,n9,n10,n11,n13,n17 code
classDef customIcon fill:none,stroke:none
class n0,n7,n8,n9,n10,n11,n17 customIcon
The Challenge: Knowledge Base Articles Take Too Long to Ship
Knowledge base work is deceptively heavy. You start with a simple question, then you’re suddenly juggling structure, tone, SEO fields, internal consistency, and that annoying “where did this claim come from?” feeling. The worst part is the context switching. Draft in one place, research in another, paste into a CMS, then reformat everything because Contentful needs specific fields. Even good writers get slowed down, and teams end up publishing less (or publishing weaker content that creates more support tickets later).
It adds up fast. Here’s where it usually breaks down.
- Drafts get written without the right metadata, so someone has to circle back for slug, meta title, and descriptions.
- Research is scattered across tabs, which means sources don’t get captured and credibility suffers.
- Editing becomes an endless thread of “can you rework this section,” because there’s no consistent revision loop.
- Publishing to Contentful turns into manual field mapping, and that’s where formatting errors sneak in.
The Fix: Prompt-to-Contentful Knowledge Base Publishing
This workflow turns a chat-style prompt into a structured knowledge base article, then pushes it directly into Contentful as a properly formatted entry. It starts the moment you send a request to the workflow’s chat webhook (a simple POST with your prompt). An AI drafting agent creates an article “skeleton” in JSON, including the fields Contentful needs: title, slug, keywords, meta fields, reading time, and difficulty. Next, the workflow calls Perplexity for deep research based on the draft’s topic, then formats the response and extracts citations so sources don’t get lost. Finally, an AI editor runs up to three revision cycles and either requests a rewrite or approves the submission. Once approved, the workflow publishes the final JSON to Contentful via an authenticated HTTP request.
The workflow starts with your prompt and immediately builds a Contentful-ready JSON outline. Perplexity then generates a long-form researched body and the workflow appends sources. After a short editorial loop (max three passes), the final article is published to Contentful without manual copy-paste.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you publish 5 knowledge base articles per week. Manually, a typical cycle might look like 30 minutes drafting, about 45 minutes researching and collecting sources, then another 30 minutes formatting and entering fields in Contentful, plus edits. That’s roughly 2 hours per article, or about 10 hours a week. With this workflow, you spend maybe 5 minutes writing a solid prompt and reviewing the output, then the Perplexity research, revision loop, and Contentful publishing runs on its own. For many teams, that’s most of a day back each week.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Contentful to store and publish the final entry.
- Perplexity API for deep research article generation.
- Contentful access token (get it from Contentful API keys).
Skill level: Intermediate. You’ll connect API credentials and confirm your Contentful field mapping once.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
A chat prompt triggers everything. You send a POST request to the webhook with “chatInput,” like a topic request or a specific question customers keep asking.
A drafting agent creates a structured article JSON. This is the big difference versus normal AI writing. Instead of dumping paragraphs into a blank doc, the workflow produces predictable fields (title, slug, keywords, meta description, reading time) so Contentful publishing is straightforward.
Perplexity research is pulled in and formatted with citations. The workflow calls Perplexity’s research endpoint, parses the response, extracts source URLs, and appends them so you keep attribution and can verify claims quickly.
An editorial loop improves quality, then publishes. An editor agent decides “rewrite” or “submit,” and the workflow will iterate up to three times. Once approved, an HTTP request publishes the final entry into Contentful.
You can easily modify the editorial rules to match your brand voice and swap the publishing target if you don’t want Contentful. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Chat Trigger
This workflow starts from a chat-based intake event that initiates the article creation pipeline.
- Add and open Chat Intake Trigger.
- Keep the default settings unless you need a custom webhook setup for your chat source.
- Connect Chat Intake Trigger to Initialize Counter.
Step 2: Connect OpenAI for Drafting and Editorial Models
Both agents use OpenAI chat models. You must add credentials to the language model nodes so the agents can run.
- Open OpenAI Chat Engine and configure your model preferences.
- Credential Required: Connect your OpenAI credentials.
- Open OpenAI Chat Engine 2 and configure its model preferences for editing.
- Credential Required: Connect your OpenAI credentials.
- Confirm OpenAI Chat Engine is attached to Drafting Agent, and OpenAI Chat Engine 2 is attached to Editorial Agent as the language models.
Step 3: Set Up Drafting Intake and Parallel Processing
This stage initializes counters and runs the first drafting pass with parallel research and parsing.
- Open Initialize Counter and set any initial fields you need for counting or tracking.
- Connect Initialize Counter so Initialize Counter outputs to both Drafting Agent and Increase Counter in parallel.
- Open Drafting Agent and configure its system prompt or instructions for initial article drafting.
- Confirm Drafting Agent outputs to both Generate Research Content and Parse Draft JSON in parallel.
Step 4: Format Research, Merge Streams, and Prepare Editorial Input
Research content is formatted with citations and merged with the parsed draft and counter before editorial refinement.
- Configure Generate Research Content with the endpoint and method you use for sourcing research content.
- Open Format Research with Citations and add code to format research responses and append citations.
- Open Parse Draft JSON and set code to parse the draft output into structured fields.
- Ensure Increase Counter is connected so its output feeds Combine Streams.
- Configure Combine Streams to merge inputs, then connect it to Format Editorial Output.
- Open Format Editorial Output and format the merged data for the editor.
Step 5: Configure Editorial Review, Validation, and Submission Parsing
The editorial phase reviews the merged content, validates limits, and branches into final parsing or resubmission.
- Open Editorial Agent and define review instructions for tone, compliance, and structure.
- Confirm Format Editorial Output connects into Editorial Agent.
- Open Validate Limit to set your editorial or counter threshold logic.
- Connect the “true” branch of Validate Limit to Halt Processing, and the “false” branch to Assess Submission.
- Open Assess Submission and configure the decision logic for final parsing or resubmission handling.
- Ensure Assess Submission connects to Parse Final JSON and Parse Submission JSON.
- Note that Parse Submission JSON outputs to both Drafting Agent and Increase Counter in parallel.
Step 6: Trigger the Sub-Workflow and Final Output Handling
Final JSON parsing and sub-workflow execution complete the automated publishing or downstream setup.
- Open Parse Final JSON and structure the final output fields for downstream use.
- Confirm Halt Processing connects to Parse Final JSON to ensure a consistent end-state.
- Open Run Sub-Workflow Setup and select the sub-workflow you want to run for publishing or storage.
- Connect Parse Final JSON into Run Sub-Workflow Setup.
Step 7: Test & Activate Your Workflow
Validate that the end-to-end process works and then activate it for live use.
- Click Execute Workflow and send a sample request through Chat Intake Trigger.
- Verify that Initialize Counter splits to Drafting Agent and Increase Counter in parallel, and that Drafting Agent outputs to both Generate Research Content and Parse Draft JSON.
- Confirm Combine Streams merges data successfully and Editorial Agent produces a refined output.
- Check that Run Sub-Workflow Setup receives the parsed JSON and starts the downstream workflow.
- When the execution completes successfully, switch the workflow to Active for production use.
Watch Out For
- Contentful credentials can expire or need specific permissions. If things break, check your Contentful API keys and environment access (space, environment, and entry permissions) first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Common Questions
Usually about an hour once you have your Contentful token and entry model ready.
Yes, but someone needs to confirm the Contentful fields map correctly. After that, it’s mostly prompts, review, and publish.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Perplexity API usage (usually a few cents per research call, depending on length).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Start by adjusting the Drafting Agent prompt so the JSON matches your content model (extra fields like product, persona, or “last reviewed” are common). You can also tune the Editorial Agent to enforce stricter rules, like “no claims without a source” or a specific reading level. If you don’t want Perplexity for research, replace the “Generate Research Content” HTTP Request with another research API and keep the same “Format Research with Citations” step.
Most of the time it’s the wrong token type or missing permissions for the space or environment. Double-check the space ID, environment name (often “master”), and that your token can update the target entry. Also confirm the request is hitting the correct Contentful endpoint (management API vs delivery API), because the delivery API won’t let you publish content.
On a typical n8n Cloud plan, you can run thousands of executions per month, and self-hosting removes execution limits (your server becomes the bottleneck). In practice, this workflow is usually gated by Perplexity response time and your editorial loop, so most teams run it “per article” rather than in huge batches. If you want to generate 50+ articles at once, add queueing and rate-limit protection so you don’t get throttled.
Often, yes. The editorial loop alone is awkward in most no-code tools because you need state (a counter), branching logic, and controlled retries, and n8n handles that cleanly. You also get the option to self-host, which can matter if you run lots of content jobs. Zapier or Make can still win for very simple “send prompt, get text, create entry” flows. If you’re unsure, Talk to an automation expert and we’ll sanity-check your use case.
Once this is running, publishing a credible, structured knowledge base article stops being a half-day event. The workflow handles the repeatable parts, and you keep control where it matters: the prompt, the review, and the final approval.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.