A powerful, low-code orchestration system built with n8n workflows for managing asynchronous and long-running tasks. This solution enables you to track external jobs (ML processes, data pipelines, API integrations, AI workflows) with automated polling, status updates, and real-time monitoring through a React frontend.
- n8n Cloud (recommended for quick start) or n8n Community Edition (self-hosted)
- The free tier of n8n Cloud is sufficient for testing and small-scale deployments
- How to get started with n8n Cloud:
- Visit n8n.io
- Click "Start free trial" (14-day trial, then free tier available)
- Create your account with email or Google/GitHub login
- Your n8n instance will be ready immediately at
your-name.app.n8n.cloud
- A Supabase project for storing task data
- The free tier is sufficient (includes 500MB database, unlimited API requests) Please be aware that Supabase doesn't allow your N8N instance to connect to the database using IPV4, you need to enable IPV6 on your docker instance/host as free tier only allows IPV6 connections, your docker needs to be able to resolve IPV6 addresses.
- How to create a Supabase account:
- Go to supabase.com
- Click "Start your project" and sign up with GitHub or email
- Create a new project (choose a region close to your users)
- Save your project URL and API keys from Settings → API
- The database will be ready in ~2 minutes
Once your Supabase project is ready:
- Go to the SQL Editor in your Supabase dashboard (left sidebar)
- Click "New query"
- Copy and paste the contents of
sql/000_initial_task_manager_migration.sql
- Click "Run" to create the table and security policies
- In Supabase dashboard, go to Settings → API
- You'll need:
- Project URL:
https://your-project.supabase.co
- Anon Public Key: Safe to use in frontend apps
- Project URL:
- Create a
.env
file in thefrontend/
directory:REACT_APP_SUPABASE_URL=https://your-project.supabase.co REACT_APP_SUPABASE_ANON_KEY=your-anon-public-key
- In Supabase dashboard, go to Settings → Database
- You'll need the connection details:
- Host: Your project database host
- Database name:
postgres
- Port:
5432
- User:
postgres
- Password: Your database password (shown once during project creation)
- In n8n, create a new PostgreSQL credential with these details
- In your n8n dashboard, click on "Workflows" in the left sidebar
- Click the folder icon to create a new folder
- Name it "Task Manager" (or any name you prefer for organization)
- This helps keep your task management workflows separate from other automations
-
Navigate to your Task Manager folder
-
Import the consolidated workflow from the
TaskManager/
directory:N8N_TaskManager.json
- The complete Task Manager system in a single workflow
This consolidated workflow includes all functionality:
- Create Task - POST webhook (
/webhook/create-task
) that creates tasks with unique IDs - Task Monitor - Scheduled every 2 mins to poll external APIs and update task status
- Query Task Status - GET endpoint (
/webhook/task-status/:taskId
) to fetch task status - Update Task - POST endpoint (
/webhook/{UUID}/update-task/:taskId
) for manual task updates
-
To import the workflow:
- Click "Add workflow" → "Import from File"
- Select
N8N_TaskManager.json
- The workflow will open in the editor
-
After importing, you'll need to:
- Update the PostgreSQL credentials in the workflow
- Activate the workflow (toggle the "Active" switch)
- Enable the Schedule trigger in the Task Monitor section if you want automatic polling
- Note the webhook URLs for your API endpoints
-
Open the
N8N_Task_Manager_Nodes.json
workflow -
Find the URL node in the workflow
-
Update the URL to point to your n8n instance:
- If using n8n Cloud:
https://your-name.app.n8n.cloud/webhook/xxx
- If self-hosted:
https://your-domain.com/webhook/xxx
- If using n8n Cloud:
-
Test the setup:
- Click on the
TM_SIMPLE_NODE
- Click "Execute Node" to run it manually
- You should receive a TaskID response like:
2d9c4c2e-c39a-4da2-aaad-2cd096e2009d
- This confirms your Task Manager is working correctly
- Click on the
- If successful, the task will be created in your Supabase database
- You can verify this in Supabase Table Editor → task_manager table
Create a separate folder for the demo workflows to see Task Manager in action:
- Create a new folder in n8n called "AI Creative Demo" (or similar)
- Import the following workflows from the
DemoVideoCreation/
directory:01__VL__Form_submission.json
- User input form for creative parameters02__VL__Image_Generation.json
- AI image generation with OpenAI03__VL__Video_Creation.json
- Video animation with Kling04__VL__Audio.json
- Text-to-speech with ElevenLabs05__VL__Lipsync_Creation.json
- Lipsync video generation
These workflows demonstrate a complete AI creative pipeline that:
- Accepts user input (image description, style, voice)
- Generates images using AI
- Creates animated videos
- Produces voice narration
- Combines everything into a lipsync video
Watch the full explanation: YouTube Tutorial - Task Manager Demo
To run the demo workflows, you'll need:
- OpenAI API - For image generation
- ElevenLabs API - For text-to-speech (Get started here)
- PiAPI - For Kling video generation (Sign up here)
- FAL API - For Tavus lipsync
Note: These are optional - the core Task Manager works without them
If you want a visual interface to monitor your tasks:
- Navigate to the
frontend/
directory - Check the
frontend/README.md
for detailed setup instructions - Quick start:
cd frontend npm install npm start
- The React app will run locally at
http://localhost:3000
- Real-time task status monitoring
- Visual display of task results (images, videos, audio)
- Running time tracking for active tasks
- Auto-refresh for live updates
- Supabase real-time subscriptions
Note: Make sure you've configured the .env
file with your Supabase credentials before starting
The consolidated Task Manager workflow (N8N_TaskManager.json
) includes all webhook endpoints in a single workflow:
-
Create Task Webhook
- Pattern:
/webhook/create-task
- Method: POST
- Creates new tasks with unique IDs
- Pattern:
-
Update Task Webhook
- Pattern:
/webhook/update-task/:taskId
- Method: POST
- The
:taskId
is dynamically replaced with the actual task ID
- Pattern:
-
Get Status Webhook
- Pattern:
/webhook/task-status/:taskId
- Method: GET
- The
:taskId
is dynamically replaced with the actual task ID
- Pattern:
After importing the consolidated workflow:
- Check that all webhook nodes show as active
- Note your n8n instance's base URL for API calls
- The webhook URLs will be:
- Create:
https://your-instance.n8n.cloud/webhook/create-task
- Update:
https://your-instance.n8n.cloud/webhook/{UUID}/update-task/{task-id}
- Query:
https://your-instance.n8n.cloud/webhook/task-status/{task-id}
- Create:
When setting up a Create Task workflow, it's essential to include two key parameters for proper task identification and tracking:
-
task_type - A descriptive identifier for the type of operation
- Examples:
"image_creation"
,"video_creation"
,"excel_file_extract"
,"data_processing"
- This helps categorize and filter tasks in monitoring
- Examples:
-
external_id - A unique identifier for the entire job
- Must be unique across all tasks
- Used to track a job through multiple stages
Use the GenerateUniqueID
code node from the demo workflows to create random 16-character alphanumeric IDs:
// Generate random 16-character alphanumeric string and assign it to 'external_id'
for (const item of $input.all()) {
item.json.external_id = [...Array(16)]
.map(() => Math.random().toString(36)[2])
.join('');
}
return $input.all();
{
"task_type": "excel_file_extract",
"external_id": "a7b3x9m2p5q8r1t6",
"poll_url": "https://api.example.com/status/job123",
"max_attempts": 10
}
This configuration ensures your tasks are properly categorized and can be tracked throughout their lifecycle.
The Task Manager system uses five status values to track task lifecycle:
- pending - Initial status when a task is created
- in_progress - Task is actively being processed
- completed - Task finished successfully
- failed - Task encountered an error and failed
- cancelled - Task was manually cancelled by user
After creating a task, it's crucial to immediately update its status to in_progress
before starting the actual workflow. This two-step process ensures proper task tracking:
- Create the task - The task is created with
pending
status - Update to in_progress - Use the Update Task webhook to set status to
in_progress
- Execute your workflow - Now start the actual work (API calls, processing, etc.)
- Final status update - Set to
completed
on success orfailed
on error
This pattern prevents tasks from appearing stalled and provides accurate monitoring of active work.
After receiving a task_id from task creation:
POST /webhook/update-task/{task-id}
{
"status": "in_progress"
}
On successful completion:
POST /webhook/update-task/{task-id}
{
"status": "completed",
"result": {
"output_url": "https://example.com/result.pdf",
"processing_time": "2m 34s"
}
}
On failure:
POST /webhook/{UUID}/update-task/{task-id}
{
"status": "failed",
"error": "API rate limit exceeded"
}
To simplify task status updates at the end of your workflows, you can use a standardized node group that handles the final status update. This group consists of 5 connected nodes:
- OutsideJSON - Sets the status to "completed"
- InsideJSON - Collects all task results and metadata
- CreateJSON - Merges the status and results into a single JSON payload
- TM_SetStatus_COMPLETE - Updates the task status via the webhook
- TriggerWorkflow - Optionally triggers the next workflow in a chain
The node group performs these operations:
-
Prepare Status (OutsideJSON node):
{ "status": "completed" }
-
Collect Results (InsideJSON node):
- Gathers all relevant data from your workflow
- Includes task_id and any output data (URLs, metadata, etc.)
-
Merge Data (CreateJSON node):
- Combines status and results into the required format:
{ "status": "completed", "result": { "task_id": "xxx", "output_url": "https://...", "processing_time": "2m 15s", // ... other results } }
-
Update Task Status (TM_SetStatus_COMPLETE node):
- Makes a POST request to the update-task webhook
- Requires authentication credentials
- URL pattern:
/webhook/{UUID}/update-task/{task_id}
-
Trigger Next Workflow (TriggerWorkflow node):
- After updating the task status, call the next workflow in your pipeline
- Use CreateTask endpoint for the next workflow
- Pass the current
task_id
andexternal_id
for easy identification - Example request:
POST /webhook/create-task { "TaskID": "{{ $json.task_id }}", "external_id": "{{ $('Webhook').item.json.body.external_id }}", "task_type": "next_processing_step" }
This node group ensures consistent task completion across all workflows and makes it easy to chain multiple workflows together while maintaining traceability through the external_id.
For questions, support, or discussions about this project:
- GitHub: Open an issue in this repository
- Community Forum: RoboNuggets on Skool
- Free Community: RoboNuggets Free on Skool