Start by importing the Source-Backed WordPress Draft template into n8n and choosing Run with sample data. The workflow imports inactive with dry run enabled. The built-in sample renders a fixed fictional article and skips OpenAI, WordPress, and the editorial Data Table. Inspect the output from Assemble cited WordPress draft to see which sources appear in each section. Package setup instructions
Build an approved source pack
The editor approves the topic, audience, brief, and source excerpts before handing the request to the workflow. Check the source’s author, version, and scope. Select passages that support the points the article needs to make, and use excerpts you have cleared for the drafting provider. Search your existing drafts and published articles first. If one already serves the same audience and question, update that entry in the editorial queue.
The package takes two to five distinct source URLs. Each source includes a title, a public HTTPS URL, and a relevant excerpt. Give the brief a stable lowercase request ID. The workflow assigns source IDs in the order supplied and passes the excerpts to the model.
The built-in example is fictional. The brief blog-demo-1042 asks for a guide to sales-to-delivery handoffs for agency operations leads.
| Source in the fictional pack | What it supports |
|---|---|
1. Internal handoff guide | Record the signed scope, delivery owner, kickoff date, and unresolved items. |
2. Project setup checklist | Assign one delivery owner and review missing access before confirming kickoff. |
The sample renders the section Check access before kickoff with this text and a link labeled Project setup checklist.
Ask the delivery owner to review missing access before confirming kickoff.
A fictional editor checks the sentence against source 2 and keeps it. If another section claimed that the checklist cut kickoff delays by 30%, the editor would remove that claim or hold it until a source supplied the measurement period, baseline, and results. A citation to the right document still needs to support the exact claim. Fictional brief and output fixture
Validate the draft before writing to WordPress
For a connected run, the package requests OpenAI JSON mode. Code then parses the reply and checks the title, excerpt, introduction, and two to six sections. Each section needs a heading, plain-text body, and at least one valid source ID. The assembler escapes text for HTML and builds the link labels and destinations from the supplied source pack. OpenAI JSON mode documentation
| Check | Operator decision |
|---|---|
Source missing, unavailable, or too thin | Replace it with an approved excerpt or narrow the brief. The input validator rejects missing excerpts and invalid source URL formats. Check that the actual pages open and support the claims during editorial review. |
Output fails JSON or field validation | Inspect the model response and brief. Correct the input or retry the drafting step after resolving the failure. Invalid output and unknown source IDs stop before a WordPress write. |
A factual sentence exceeds its source | Remove it or get better evidence. Check the title, excerpt, and introduction as well as section text. The assembler adds source links to sections. |
A similar article or draft already exists | Compare the reader question and intended canonical page. Update the existing draft when it serves the same purpose. Use a new revision ID only when you intend to create another draft through this workflow. |
Keep the publishing decision with an editor
Use the webhook acknowledgment as a receipt. After a connected run, verify the WordPress post ID and draft status. The package writes that status explicitly and records the confirmed post ID in its Data Table. Treat the draft and the matching editorial request as one review item. WordPress Posts REST API
The assigned editor checks each factual sentence against the cited passage, opens the links, and previews headings, lists, paragraphs, and the excerpt in WordPress. The editor also checks approved author credit, media rights, and whether an existing page should be updated. Record the request ID, post ID, source versions, approving editor, and exact revision approved. A publisher with the right WordPress permissions can publish or schedule that revision after sign-off. Send edits that change factual claims back for review.
Recover an interrupted draft without creating a duplicate
The workflow checks the Data Table for the request ID before drafting. On a connected run, it records draft_pending and the expected slug before calling WordPress. After WordPress returns a post ID and confirms draft status, the table entry becomes draft_ready. This supports serial retries of the same request. Keep concurrent submissions for a request ID serialized by the editorial queue.
- For
draft_ready, open the recorded post ID and continue editing there. - For
draft_pending, check WordPress using the recorded slug and the title from the assembled draft payload. For the fictional example, the expected slug isuptune-draft-blog-demo-1042. If you find the matching draft, record its post ID and reconcile the table entry asdraft_ready. - If you find nothing, confirm the execution has ended and check WordPress again before clearing the pending entry and retrying the same request ID. Escalate duplicate table rows, multiple matching posts, or an unexpected post status to the editorial owner before retrying.
Verify connected behavior in staging
Follow the package setup instructions for the n8n Data Table, authenticated intake webhook, OpenAI credential, and WordPress access. Give the workflow a WordPress account with permission to create drafts and keep publication with the editor or publisher. WordPress Application Passwords can be used with HTTP Basic Authentication over HTTPS. WordPress Application Passwords handbook
Use staging credentials and run one connected test with dry run disabled. Confirm one draft appears, compare its cited links with the brief, and verify the ID recorded in the table. Repeat the same request ID and confirm the existing record prevents another draft. Test a missing source, an invalid source ID in a model response, and an interrupted WordPress response. The package report covers an isolated n8n sample and mocked edge cases. Connected OpenAI, webhook, and WordPress behavior needs staging verification with your accounts. Package validation report
For prerequisites, see the n8n tool notes and OpenAI tool notes. Use the content publishing blueprint to plan what happens after approval, or discuss a scoped implementation through AI automation services.