Have AI build an n8n workflow from one request
44 copy-ready prompts for AI agents such as Claude, Cursor, and Windsurf. Labels for czlonkowski/n8n-mcp v2.79.0 are checked against n8n v2.32.7. The Public API supports POST /api/v1/workflows, uses PUT /api/v1/workflows/:id for updates, and supports POST /api/v1/workflows/:id/activate. Tests are MCP- or trigger-specific, not an undocumented REST operation. Select “Copy” on any card and paste it into your AI conversation.
What this is
Dragging n8n nodes is quick, but engineers and PMs who already write code with AI can work faster: let AI produce workflow JSON and put it into n8n. This handbook contains 44 prompts for real work scenarios. REST labels name only endpoints documented for n8n v2.32.7; MCP-only behavior is named explicitly and may require the selected server’s additional configuration.
There are two integration methods:
- n8n MCP server (recommended): these cards pin
n8n-mcp, notn8n-workflow-builder, at v2.79.0. Do not treat generic names such ascreate_workfloworactivate_workflowas portable: the operation labels below use the pinned server’s actual names. Inspect a diff before allowing a write. - Call the REST API directly: generate a curl or SDK call, authenticate with the
X-N8N-API-KEYheader, and use the documented/api/v1/workflowsroute printed on the card. On n8n v2.32.7, workflow updates replace the submitted definition with PUT, not PATCH.
How to use these prompts (3-minute setup)
-
Install an n8n MCP server (recommended)
Add
npx -y [email protected](czlonkowski/n8n-mcp, pinned here). Do not substitutenpx @makafeli/n8n-workflow-builder(a different server) without rechecking every operation. Older generic labels such ascreate_workflowandactivate_workfloware not the pinned tool names printed below. -
Set the n8n API environment variables
This MCP version needs
N8N_API_URL(for example,https://n8n.woowtech.io) andN8N_API_KEY(create it under Settings → n8n API). Confirm that the target instance is v2.32.7 before relying on the route labels below. -
Choose a prompt and select “Copy”
Paste it into Claude or Cursor. Replace the placeholder-like fields—Slack channel, Airtable base, and sheet name—with your own.
-
Have AI report before it acts
For requests that build workflows, keep the instruction “show me the JSON structure before creating it.” This prevents AI from running unpredictably with real credentials.
A · Workflow generation (create / update / delete)
The most direct category creates a workflow from one request. AI calls POST /api/v1/workflows to create it and decide whether to activate it.
In n8n, create a workflow named “Order notifications”: Webhook trigger (POST /order-in) → Set extracts order_id/total/email → Google Sheets Append to sheet ID 1abcdef, tab “orders” → Slack sends “New order {{ $json.order_id }}, ${{ $json.total }}” to #sales. Show me the workflow JSON for approval before calling n8n_create_workflow. Respond in English.
Example: reviewing JSON before creation is a basic safety practice.
List all workflows currently in n8n, sorted by updatedAt with the most recently changed first. Output: id, name, active status, last update time, and tags. Respond in English.
→ n8n_list_workflows / GET /api/v1/workflowsGet the complete definition of workflow ID xyz789 from n8n. Compare it with the JSON below in diff format and identify changed fields and added nodes. Respond in English.
In workflow ID abc123, change the Slack channel from #sales to #sales-regional and change nothing else. Retrieve the complete workflow, show me the before/after diff, and wait for approval before replacing it. Respond in English.
Duplicate workflow id abc123 into a new workflow with the suffix -staging. In the copy, change every Slack channel to #staging-alerts and the Google Sheet ID to 1STAGING. Keep it inactive. Respond in English.
Keep workflow ID abc123 inactive while testing. If it has a Webhook, Form, or Chat trigger, use n8n_test_workflow with its documented trigger method three times; otherwise give me the editor steps to run it manually three times. Then list those executions and report any failed node. Activate only after I approve the results. Respond in English.
List all workflows and filter names containing “test” or “staging.” Show me the candidates. After I approve, loop over the approved IDs and deactivate them one at a time; report each result and stop on any failure. I will issue a separate instruction for deletion. Respond in English.
→ GET /api/v1/workflows (paginate) → POST /api/v1/workflows/:id/deactivate (explicit loop)Safety: deactivate first; do not delete proactively.
B · Trigger setup (webhook / cron / watcher)
A trigger is the entry point to a workflow. These prompts show how to specify different trigger types.
Create a workflow whose Webhook listens for POST /line-webhook, uses response mode responseNode (“Using Respond to Webhook Node” in the UI), enables Raw Body, and does not pretend that built-in Webhook authentication can verify LINE HMAC. Verify LINE’s base64 HMAC-SHA256 over the original raw bytes and compare it with X-Line-Signature using a timing-safe comparison. Ordinary Code nodes cannot read named n8n credentials, so do not reference a credential by a display name such as line-secret. Supply the channel secret only through deployment-approved self-hosted environment-variable access (which is configuration-dependent), or delegate verification to a dedicated service/custom node. Then branch to Respond to Webhook: return 401 and stop on mismatch; only the success branch parses and processes events[0]. Never calculate the HMAC from re-serialized JSON. Respond in English.
Create a Schedule Trigger workflow that runs at 8:00 every weekday (Monday–Friday) in your timezone. Skip public holidays by calling sub-workflow holiday-check. Note: replace the timezone and holiday calendar with those for your location. Respond in English.
Use Gmail Trigger to poll every 5 minutes for new messages with label invoice. Add an IF downstream that continues only when an attachment is a PDF. Use credential gmail-corp. Respond in English.
Google Drive Trigger watches folder ID 1FOLDER, with event fileCreated, checking every 10 minutes. When a new file appears, extract its text → save it to Airtable base ID appBASE, table Docs. Respond in English.
Create two connected workflows: (A) every 15 minutes, Cron queries Notion database ID DB1 for pages with status=Ready; (B) Execute Workflow calls another workflow to process each page and writes the result back to Notion. Keep them separate to avoid one overly complex workflow. Respond in English.
C · Data transformation (Edit Fields / Code / Split Out / Aggregate)
Data shaping is one of the most frequent tasks in a workflow. These prompts let AI choose between Set and Code.
In existing workflow ID abc123, insert a Set node (Edit Fields) after Webhook. Use n8n expressions based on $json to lowercase $json.body.customer.email, convert $json.body.total to a number, and convert $json.body.created_at to ISO 8601 UTC. Discard other fields. Respond in English.
Insert a Code node (JavaScript). Flatten the previous node’s items, including the nested orders array, to one row per order. Keep the original customer_id in every item, expand each order into a separate item, and map its fields from orders[i]. Respond in English.
→ n8n_update_full_workflow / PUT /api/v1/workflows/:id (Code node)If the API returns one item containing a records array, use Split Out on records to create one item per record. Route categories A/B/C with Switch, process each route with Loop Over Items in batches of 20 to respect rate limits, then use Aggregate to collect processed IDs for one summary message. Respond in English.
→ n8n_update_full_workflow / PUT /api/v1/workflows/:idWrite a Code node that deduplicates by email. For duplicates in one batch, keep only the item with the latest created_at. Provide JavaScript with detailed comments and a separate Python version. Respond in English.
→ n8n_update_full_workflow / PUT /api/v1/workflows/:id (Code node)Use Edit Fields after merging three upstream nodes (A, B, and C) into one item. Prefix field names with a_*/b_*/c_* to avoid collisions. Fill missing fields with null instead of dropping them. Configure Merge with Number of Inputs = 3, Mode = Combine, and Combine By = Position. Respond in English.
D · SaaS integrations (Slack / Gmail / Notion / Airtable / Google Sheets)
These are common production scenarios. Replace each credential ID with your own.
Create a workflow: Slack Trigger listens for message events in #customer-support. If a message contains keyword refund or refund request, use Notion to create a page in database ID refunds, with user ID, message content, and time in properties. Reply in the original Slack thread: “Ticket created and being tracked.” Respond in English.
Create a Gmail receipt → Airtable record workflow: Gmail Trigger label=leads; use AI Agent to extract name/company/phone/interest; write to Airtable base=appLEADS, table=Leads; if nobody replies within 24 hours after record creation, send an automated reminder using Wait + Gmail send. Respond in English.
Create a Google Sheets read/write workflow: every day at 8:00, Cron reads sheet 1ORDERS range A2:F → filter yesterday’s orders → total revenue by region → write to tab daily-summary in the same sheet (append mode, one row per day). Respond in English.
Create a Slack Approval workflow. After a webhook trigger, send an interactive message with Approve/Reject buttons to #approvals. Wait for up to 24 hours. Approve takes the upper branch and calls the internal payout API; Reject takes the lower branch and replies to the requester in Slack; timeout takes a third branch and escalates to a manager. Respond in English.
→ n8n_create_workflow (Slack Interactive + Wait + IF)Build this explicit request loop: HTTP Request sends POST https://api.internal.com/v1/tickets with Authorization: Bearer using credential internal-api-key and a JSON body mapped from the previous item. Return the full response without throwing on HTTP status. Switch on status: succeed for 2xx; for 429 or 5xx, increment attempt, stop after 3 retries, otherwise Wait for 2 raised to the attempt count seconds and loop back; fail immediately for every other status. Preserve one logical item through the loop. Respond in English.
If the API-key owner is the n8n instance owner or an admin, call the n8n v2.32.7 Public API to list credentials and return only id, name, and type; do not request or display secret data. If the account is not owner/admin, stop and explain that this list operation is unavailable rather than attempting an internal endpoint. I want to identify candidates for a separate human review; do not delete anything. Respond in English.
→ GET /api/v1/credentials (v2.32.7; instance owner/admin only)E · AI Agent nodes (LangChain / Chat Model / Memory / Tool)
The LangChain node family introduced after n8n v1 gives workflows an AI Agent node that can make judgments.
Create a customer-support routing workflow: LINE Webhook receives a message → AI Agent (select a model available in my instance; prompt defines 4 categories: returns/technical issues/general inquiries/other) → Structured Output returns {category, confidence, reasoning} → Switch branches by category. If confidence < 0.7, use “other.” Respond in English.
Connect three tools to AI Agent: (1) HTTP Request queries an internal order API for status; (2) Notion Read queries the FAQ database; (3) Google Sheets Read queries the returns policy. Instruct it in the system prompt to check the FAQ first, the order API second, and cite the policy only last; end every response with sources. Respond in English.
→ n8n_update_full_workflow / PUT /api/v1/workflows/:id (AI Agent + tools)Create an AI Agent + Memory workflow: Chat Trigger + AI Agent + Buffer Window Memory (size=10) + OpenAI Chat Model. Pass sessionId from Chat Trigger’s sessionId field to retain conversation context for one user. Add Structured Output Parser so every response is {reply, next_action, tags[]}. Respond in English.
Create a PDF-summary workflow: Google Drive Watcher (PDF appears) → Extract from File → AI Agent (Claude Sonnet; prompt: three-part summary + tags + sentiment) → Airtable Upsert into Feedback. Limit concurrency to 5 to protect the API. Respond in English.
→ n8n_create_workflow (Drive + Extract + AI + Airtable)Duplicate workflow ID abc123 as an inactive test copy. In the copy, replace its current chat model with a model available in my instance, preserve the prompt and temperature, and use credential anthropic-prod. Test through a documented Webhook/Form/Chat trigger with n8n_test_workflow, or give me manual editor steps if it has no supported trigger. Show the result and wait for approval before applying the same change to the original. Respond in English.
Create a Multi-Agent workflow: Chat Trigger → AI Agent “Router” identifies technical vs sales questions → branch to two specialist AI Agents (Tech Support / Sales Consultant), each with different tools and memory. Router identifies which agent produced the response. Respond in English.
→ n8n_create_workflow (3× AI Agent)F · Error handling and monitoring (Error Workflow / Retry / Alerting)
Production workflows do fail. What matters is how you recover.
Create a global Error Workflow: Error Trigger → Set extracts workflow name/failed node/error message/timestamp → Slack sends to #n8n-alerts with details in a code block → if the same workflow fails more than 3 times within 24hr, send another message tagging @on-call. Respond in English.
→ n8n_create_workflow (Error Trigger)In workflow ID abc123 settings, add errorWorkflow: <error workflow ID from the previous prompt>. List every workflow whose name contains -prod and wait for approval. Then retrieve and update each approved workflow one at a time with the complete required body; report each result and stop on failure. Respond in English.
Implement status-aware retries as workflow nodes, not as native Retry On Fail or continueOnFail: true: initialize attempt=0 → HTTP Request returns the full response without throwing on HTTP status → Switch. For 2xx, continue; for 429/500/502/503/504, increment attempt, fail after 5 total attempts, otherwise Wait for an initial 2 seconds doubled after each failure and loop back; for every other status, fail immediately. Keep the final error response for downstream handling. Respond in English.
Create a “Daily health check” workflow: Schedule Trigger runs every day at 07:00 → retrieve every active workflow with pagination → loop over workflow IDs → retrieve every error execution for each workflow with pagination → filter to the previous 24 hours → aggregate errors as a Slack table → send to #n8n-daily-health. When there are no errors, send “Everything is healthy today.” Respond in English.
→ n8n_create_workflow + GET /api/v1/workflows + GET /api/v1/executions (explicit paginated loops)Create a workflow: Schedule Trigger runs hourly, retrieves executions from the previous hour with documented execution-list pagination, and calculates the failure rate. If it is >5%, notify me. If it is >20%, identify the workflow with the most failures and ask for approval. Treat deactivate_workflow as a generic label; after approval, use the documented deactivation endpoint printed below and notify me. Respond in English.
G · Workflow debugging (read logs, inspect executions, make changes)
When a workflow fails overnight, these prompts help AI find the failing component.
Workflow id abc123 failed last night in execution ID exec_9876. Retrieve the full execution log and report: (1) failed node, (2) input JSON it received, (3) error message, and (4) likely cause and three possible fixes. Respond in English.
List workflow ID abc123 failures from the previous 7 days, sorted by time. Group failure messages by expired credential/timeout/validation error/other. Identify the largest group and the average interval between failures. Respond in English.
Workflow id abc123 is slow, averaging 45 seconds per execution. Retrieve node timings from the most recent 20 executions, identify the bottleneck, and recommend a fix such as caching, changing the API endpoint, or extracting a sub-workflow. Respond in English.
Do not call run_workflow or invent a Public API run route. For workflow ID abc123, prepare this test input: {"customer_id": "test_001", "amount": 100}. If it has a supported Webhook, Form, or Chat trigger, use n8n_test_workflow with that trigger; otherwise tell me how to pin the input and select Test workflow in the editor. After it runs, retrieve the execution with data and list every node’s input and output. Respond in English.
Workflow ID abc123 has a Google Sheets node reporting “credential expired.” (1) Read its credential reference from the workflow JSON. (2) If I am the instance owner or an admin, confirm the credential’s id/name/type through GET /api/v1/credentials; otherwise skip that call. (3) Give me the n8n UI steps to reconnect it. (4) Tell me how to test it through its documented trigger or manually in the editor. Respond in English.
Validate the workflow JSON below. Find (1) syntax errors, (2) dangling connections, (3) missing credential references, and (4) clear performance problems such as calling one API 200 times without batching. Return the complete corrected JSON. Respond in English.
→ n8n_validate_workflow (n8n-mcp v2.79.0; local/MCP validation, not a Public API route)H · Operations (tags / audit / backup / export)
Operations covers workflow naming, audits, and backup strategy.
Retrieve every workflow with pagination and list those without tags. Recommend tags based on name, trigger, and downstream SaaS, and provide an assignment table. Wait for approval, then update the approved workflow-tag assignments one at a time and report every result. Respond in English.
→ GET /api/v1/workflows (paginate) → PUT /api/v1/workflows/:id/tags (explicit loop)Run an n8n Security Audit (POST /api/v1/audit). Classify results as Critical/High/Medium/Low and provide a fix for every Critical item. Respond in English.
For each active workflow, treat get_workflow as a generic label and use the documented retrieval endpoint to fetch complete JSON. Package everything in a backup zip with file-name format {workflow_id}_{name_slug}.json, and generate index.md listing every backup item. Respond in English.
I want to copy workflow ID dev_abc from the development host (n8n-dev.woowtech.io) to the production host (n8n.woowtech.io). Retrieve its complete JSON from development, list its credential references, and ask me for an explicit production credential mapping. After I approve the mapping and JSON diff, create it in production without activating it. Keep the base URLs and API keys in separate named MCP configurations; never send either key to the other host. Respond in English.
Prompt-writing cheat sheet
Across these 44 prompts, five techniques recur:
| Say this | Not this | Why |
|---|---|---|
| State the goal + approximate node order: “Webhook → Set → Sheet → Slack” | Only “Build a notification workflow” | A goal and node order produce JSON closer to the intended shape, reducing revisions |
| Specify IDs: sheet ID, Notion database ID, channel, credential name | “Use my usual sheet” | AI has no memory here. Be specific; ambiguity produces unreliable results |
| Report before acting: “Show me the JSON before creating it” | “Build and activate it immediately” | One sentence adds a safeguard to requests involving credentials |
| Include error handling: retry count, statuses to retry, and failure recipient | Describe only the happy path | Without an error strategy, AI usually skips it; you discover the omission only in production |
| Test first: “Use a documented trigger or the editor and let me review the execution before activation” | Activate immediately after creation | A pre-activation test checks the data path without claiming an undocumented Public API run endpoint |
FAQ
Must I copy each prompt word for word?
Can I use these without installing an MCP server?
Which MCP server should I use: czlonkowski/n8n-mcp or makafeli/n8n-workflow-builder?
czlonkowski/n8n-mcp at v2.79.0; makafeli/n8n-workflow-builder may use different names or unsupported internal routes. Verify the installed release before switching. Skill Handbook has a more detailed comparison.Will AI make uncontrolled changes to production workflows?
Do these prompts use many tokens?
czlonkowski/n8n-mcp supports 2,541 nodes), so the first conversation uses more tokens. Usage stabilizes afterward. Choose a strong reasoning model such as Claude Sonnet or GPT-4o: workflows are code, and better judgment produces more accurate output.What access does MCP need to call the n8n API?
X-N8N-API-KEY header. Enterprise lets the creator select API scopes; Community/non-Enterprise keys have the creator’s full account capabilities. Project access still limits which resources that account can reach. Public routes use /api/v1/*; in n8n v2.32.7, credential listing is additionally restricted to the instance owner or an admin.Take this handbook with you
The handbook is a self-contained single HTML file with embedded icons. Download it to open offline or forward to your team.