AutomationFlows โ€บ AI & RAG โ€บ ๐Ÿค– Trigger CrewAI Agent

๐Ÿค– Trigger CrewAI Agent

๐Ÿค– Trigger CrewAI Agent. Uses httpRequest, respondToWebhook, splitInBatches. Webhook trigger; 15 nodes.

Webhook triggerโ˜…โ˜…โ˜…โ˜…โ˜† complexity15 nodesHttp Request
AI & RAG Trigger: Webhook Nodes: 15 Complexity: โ˜…โ˜…โ˜…โ˜…โ˜†

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide โ†’

Download .json
{
  "name": "\ud83e\udd16 Trigger CrewAI Agent",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "trigger-agent",
        "responseMode": "responseNode",
        "options": {}
      },
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        300,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "http://host.docker.internal:8010/crews/research",
        "jsonParameters": true,
        "options": {
          "timeout": 30000
        },
        "bodyParametersJson": "={{ JSON.stringify({ \"topic\": $json.body.topic || \"AI trends in 2024\", \"output_type\": $json.body.output_type || \"report\", \"llm_provider\": $json.body.llm_provider || null, \"llm_model\": $json.body.llm_model || null }) }}"
      },
      "name": "Start Research Crew",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        550,
        300
      ]
    },
    {
      "parameters": {
        "amount": 5,
        "unit": "seconds"
      },
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        800,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "GET",
        "url": "=http://host.docker.internal:8010/jobs/{{ $node['Start Research Crew'].json.job_id }}",
        "options": {
          "timeout": 10000
        }
      },
      "name": "Check Job Status",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1050,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "operation": "equals",
              "value2": "completed"
            }
          ]
        }
      },
      "name": "Is Completed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1300,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "operation": "equals",
              "value2": "failed"
            }
          ]
        }
      },
      "name": "Is Failed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1300,
        500
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ \"success\": true, \"job_id\": $node['Start Research Crew'].json.job_id, \"result\": $json.result }) }}"
      },
      "name": "Return Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1550,
        200
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ \"success\": false, \"job_id\": $node['Start Research Crew'].json.job_id, \"error\": $json.error }) }}",
        "options": {
          "responseCode": 500
        }
      },
      "name": "Return Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1550,
        500
      ]
    },
    {
      "parameters": {
        "loopCount": 60,
        "options": {}
      },
      "name": "Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        1550,
        700
      ]
    },
    {
      "parameters": {
        "amount": 10,
        "unit": "seconds"
      },
      "name": "Wait More",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1800,
        700
      ]
    },
    {
      "parameters": {
        "requestMethod": "GET",
        "url": "=http://host.docker.internal:8010/jobs/{{ $node['Start Research Crew'].json.job_id }}",
        "options": {
          "timeout": 10000
        }
      },
      "name": "Poll Job Status",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        2050,
        700
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "operation": "equals",
              "value2": "completed"
            }
          ]
        }
      },
      "name": "Poll Completed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        2300,
        700
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ \"success\": true, \"job_id\": $node['Start Research Crew'].json.job_id, \"result\": $json.result }) }}"
      },
      "name": "Return Poll Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        2550,
        600
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "operation": "equals",
              "value2": "failed"
            }
          ]
        }
      },
      "name": "Poll Failed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        2550,
        800
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ \"success\": false, \"job_id\": $node['Start Research Crew'].json.job_id, \"error\": $json.error }) }}",
        "options": {
          "responseCode": 500
        }
      },
      "name": "Return Poll Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        2800,
        750
      ]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Start Research Crew"
          }
        ]
      ]
    },
    "Start Research Crew": {
      "main": [
        [
          {
            "node": "Wait"
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Check Job Status"
          }
        ]
      ]
    },
    "Check Job Status": {
      "main": [
        [
          {
            "node": "Is Completed?"
          }
        ]
      ]
    },
    "Is Completed?": {
      "main": [
        [
          {
            "node": "Return Success"
          }
        ],
        [
          {
            "node": "Is Failed?"
          }
        ]
      ]
    },
    "Is Failed?": {
      "main": [
        [
          {
            "node": "Return Error"
          }
        ],
        [
          {
            "node": "Loop"
          }
        ]
      ]
    },
    "Loop": {
      "main": [
        [
          {
            "node": "Wait More"
          }
        ]
      ]
    },
    "Wait More": {
      "main": [
        [
          {
            "node": "Poll Job Status"
          }
        ]
      ]
    },
    "Poll Job Status": {
      "main": [
        [
          {
            "node": "Poll Completed?"
          }
        ]
      ]
    },
    "Poll Completed?": {
      "main": [
        [
          {
            "node": "Return Poll Success"
          }
        ],
        [
          {
            "node": "Poll Failed?"
          }
        ]
      ]
    },
    "Poll Failed?": {
      "main": [
        [
          {
            "node": "Return Poll Error"
          }
        ],
        [
          {
            "node": "Loop"
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionTimeout": 600
  }
}

About this workflow

๐Ÿค– Trigger CrewAI Agent. Uses httpRequest, respondToWebhook, splitInBatches. Webhook trigger; 15 nodes.

Source: https://github.com/vagulans/ai-platform/blob/965d60c2bd5d7380ee7c94d3f39799d877e0641d/n8n-workflows/03-trigger-agent.json โ€” original creator credit. Request a take-down โ†’

More AI & RAG workflows โ†’ ยท Browse all categories โ†’