Automation is where an LLM stops being a chat and starts doing work. An event comes in, a model decides what it means, and tools act on the site. The model never touches the database; it only calls the tools you give it.
What it is
An AI workflow has four parts:
- Trigger: something happened: a form submission, a comment, a ticket, a schedule.
- Agent: an LLM with instructions that reads the input and decides what to do.
- Memory: recent context, so the agent does not treat every message as the first one.
- Tools: actions the agent may call: create a draft, raise a notification, write a log.
How it works with WordPress
There are three places the workflow can live.
flowchart TB
subgraph EXT["1. External workflow"]
N8N["n8n, Make, Zapier"]
end
subgraph IN["2. Inside WordPress"]
CRON["WP-Cron or a queue"] --> AIC["Core AI Client"]
end
subgraph AG["3. Agent"]
AGENT["Claude, Cursor, CI bot"]
end
WP["WordPress<br/>REST API · Abilities API"]
N8N -->|REST| WP
AIC --> WP
AGENT -->|MCP| WP
- External workflow. A tool like n8n receives the event, runs the agent and calls WordPress through the REST API. Fast to change, visible as a diagram, lives outside the site.
- Inside WordPress. A plugin runs the job in the background with WP-Cron or a queue and asks the model through the core AI Client. Everything stays in one codebase.
- Agent. An external agent reaches the site through MCP and acts only through abilities declared with the Abilities API.
The rule is the same everywhere: the model decides, WordPress code acts and checks permissions.
The n8n model: support triage agent
Our n8n template “4WP AI Support & Content Triage Agent” shows the full shape.
flowchart LR
T["Webhook<br/>form, comment, ticket"] --> A["AI Agent"]
M["Chat model"] -.-> A
MEM["Session memory<br/>10 messages per site"] -.-> A
A -.->|tool| F["Create FAQ draft<br/>4WP FAQ"]
A -.->|tool| N["Create notification<br/>4WP Notifications"]
A -.->|tool| L["Log<br/>Google Sheets"]
A --> R["Respond to caller"]
How the agent decides:
flowchart TB
IN["Incoming message"] --> Q{"What is it?"}
Q -->|recurring question| FAQ["FAQ draft for review"]
Q -->|error, complaint, anomaly| NOTE["Notification to a human"]
Q -->|noise| NONE["No action"]
FAQ --> LOG["Log every message"]
NOTE --> LOG
NONE --> LOG
Instructions that matter:
- The agent works through the REST API only: no shell, no database, only the tools it was given.
- FAQ entries are always created as drafts for human review, never published.
- Every message is logged once, whatever the decision.
The WordPress side:
| Tool | Endpoint | What it needs |
|---|---|---|
| FAQ draft | POST /wp-json/wp/v2/faq with status: draft | The faq post type is exposed to REST by 4WP FAQ |
| Notification | POST /wp-json/forwp/v1/notifications | title, type, recipients; a user allowed to send notifications |
What we learned building it: an agent template is only as good as its endpoints. The first version of our template used illustrative routes and fields; we corrected them against the plugins’ code. Check routes and permissions against the installed plugins before you connect a workflow.
Challenges
| Challenge | What to do |
|---|---|
| The agent does more than intended | Give it the minimum set of tools; nothing else exists for it |
| Credentials | A dedicated user with minimal capabilities; application passwords or header auth |
| Wrong decisions | Drafts and notifications, not direct publishing; a human approves |
| Traceability | Log every input and every action |
| Loops | A tool must not trigger the same workflow again |
| Changing plugins | Endpoints change with versions; prefer abilities as a stable contract |
| Cost | Filter noise before the model when a rule is enough |
Opportunities
- Turn incoming messages into FAQ, so support answers once and the site answers next time.
- Route urgent signals to people instead of inboxes.
- Keep a log that shows what visitors actually ask.
- Reuse the same plugin actions for n8n, cron jobs and agents.
Where it is used
| Area | Example |
|---|---|
| Support | Triage questions, draft answers |
| Content | Intake from forms, drafts for editors |
| FAQ | Build the knowledge base from real questions |
| Operations | Alerts on errors and anomalies |
| Reporting | Logs and summaries of activity |
What a specialist should be able to do
- Decide where the workflow lives: outside, inside WordPress or as an agent.
- Expose site actions safely: REST routes or abilities with permission checks.
- Design agent instructions and limit its tools.
- Keep humans in the loop for anything public.
FAQ
n8n or a plugin?
An external workflow is faster to change and easy to see. A plugin keeps logic and data inside WordPress. Both can call the same actions.
Does the agent get database access?
No. It calls endpoints, and WordPress checks permissions on every call.
Can it publish content?
It can if you allow it. In our template it creates drafts only.
Which model does it need?
A chat model that supports tool calling. The template uses an OpenAI chat model; swap it for any compatible one.
What if the plugin changes?
Endpoints can change between versions. Abilities give agents a declared contract instead of raw routes.