n8n Workflows
Automate task processing with n8n integration
n8n Workflow Integration
This guide covers how to integrate Workflow with n8n for automated task processing.
For long-running requests and recommended designs (Option A vs Option B), see docs/N8N_ASYNC_PATTERNS.md.
Overview
The n8n integration allows you to create automated workflows that:
- Trigger on ClickUp task assignment changes
- Send tasks to Claude Code for planning or implementation
- Update tasks with results automatically
Workflow Architecture
graph TD
A[ClickUp Task Created] -->|Assigned to bot| B[Trigger Planning Flow]
B --> C[Fetch Task Info<br/>+ optional sourceBranch]
C --> D[Send Prompt to Claude Code<br/>via Planner Template]
D --> E[Claude Planner Agent<br/>Analyzes Codebase]
E --> F[Refined Task Output:<br/>Title, Steps, Files, DoD]
F --> G[Update Task in ClickUp]
G --> H[Task Assigned to Dev-Test Agent]
H --> I[Dev Agent Pulls Code<br/>Implements Task<br/>Runs Tests<br/>Creates PR]
Planner Flow Design
The planner flow automates task refinement before development begins.
Flow Steps
- Trigger: Assignee change on any task
- Fetch: Get the task details
- Check: Verify task was assigned to CodeSpider and is in "To Do" status
- Parse: Extract task information:
- Title
- Description
- Bug label (can be null)
- Template: Use prompt template to complete the prompt
- Generate: Create payload for API
- Send: Send payload to Workflow API
- Receive: Get response from Claude
- Update Task:
- Remove assignee
- Leave comment with results
- Update title, description, etc.
Configuration Notes
| Setting | Description |
|---|---|
| Workspace ID | Define in n8n global variables |
| Bug Labels | Configure label detection for bug tasks |
| API Endpoint | Your Workflow instance URL |
Setting Up the Integration
Prerequisites
- n8n instance (self-hosted or cloud)
- ClickUp workspace with API access
- Workflow instance with API authentication configured
Step 1: Configure ClickUp Trigger
Set up a ClickUp trigger node that watches for assignee changes on tasks.
Step 2: Add HTTP Request Node
Configure an HTTP request to your Workflow API:
POST /api/ask Authorization: Bearer YOUR_API_KEY Content-Type: application/json
Example JSON body:
{
"workspaceId": "your-workspace-id",
"question": "Your prompt text here",
"context": "Optional extra context"
}
Notes:
sourceBranchis optional. If omitted, the server defaults to the workspacetargetBranch.- For edits, use
POST /api/edit(and optionally setcreateMR: true). For large requests, expectqueued: truefrequently. - For webhook-driven processing (recommended for large jobs), submit with a
callbackobject and handle completion in a separate workflow. Seedocs/N8N_ASYNC_PATTERNS.md.
Step 3: Parse Response
Use a Set node to extract the Claude response and format it for ClickUp.
Step 4: Update ClickUp Task
Use the ClickUp node to update the task with the refined information.
Next Steps
- See Prompt Templates for the planner prompt format
- See API Operations for API endpoint details
- See API Authentication for securing your integration
- See
docs/N8N_ASYNC_PATTERNS.mdfor robust async patterns and modular processing flows