N8N Tools - CrewAI Flow
Overview
The CrewAI Flow node enables users to create and manage complex workflows composed of multiple "crews" (sub-processes or tasks) with advanced orchestration capabilities. It supports defining the flow structure, execution methods, conditional logic, event-driven triggers, error handling, monitoring, and retry policies.
This node is beneficial in scenarios where you need to coordinate multiple automated tasks or microservices in a flexible manner, such as:
- Automating multi-step business processes that require sequential or parallel task execution.
- Implementing conditional workflows that branch based on dynamic criteria.
- Creating event-driven automation triggered by external events or signals.
- Managing retries and error notifications for robust workflow execution.
For example, you could use this node to orchestrate a customer onboarding process where different crews handle data validation, account creation, notification sending, and logging, with conditional steps depending on user input or external events.
Properties
| Name | Meaning |
|---|---|
| Flow Name | Name or identifier for the flow. |
| Description | Description explaining what the flow accomplishes. |
| Flow Structure | JSON defining the flow's internal structure, including steps and connections between crews. |
| Execution Method | How the flow executes its crews. Options: • Sequential - execute crews one after another • Parallel - execute crews in parallel when possible • Conditional - execute crews based on conditions • Event-Driven - execute crews based on events and triggers |
| Conditions | JSON defining conditional logic for crew execution; shown only if Execution Method is "Conditional". |
| Event Configuration | Collection of settings for event-driven execution; shown only if Execution Method is "Event-Driven". Includes: • Event Sources - list of event sources to listen to • Event Handlers - JSON mapping events to crew executions |
| Input Schema | JSON schema describing the expected input data format for the flow. |
| Output Schema | JSON schema describing the output data format produced by the flow. |
| Advanced Options | Collection of advanced settings: • Max Execution Time (seconds) - maximum allowed time for flow execution • Enable Rollback - whether to rollback on failure • Retry Policy - none, simple, exponential, linear • Max Retries - max retry attempts (if retry enabled) |
| Error Handling | Collection of error management options: • Continue on Error - whether to continue flow execution if a crew fails • Error Notification - none, email, webhook, slack • Notification Config - JSON config for notifications (shown if notification enabled) |
| Monitoring | Collection of monitoring options: • Enable Detailed Logging - enable detailed logs • Log Level - debug, info, warning, error • Enable Metrics - whether to collect metrics • Metrics Config - JSON config for metrics collection (shown if metrics enabled) |
| Report Issue | Notice with link to report bugs or get help. |
| Request Feature | Notice with link to request new features or enhancements. |
Output
The node outputs a single main output containing JSON data representing the created or managed flow. The output JSON includes metadata about the flow execution result returned from the CrewAI API, structured as an array with one item per execution.
No binary data output is indicated.
Dependencies
- Requires an API key credential for authenticating with the CrewAI API service.
- Uses the
crewAiApiRequesthelper function to communicate with the CrewAI backend. - No other external dependencies are required.
- Proper configuration of the API credential in n8n is necessary.
Troubleshooting
- No Crews Connected: If no crews are connected to the "Crews" input, the node throws an error indicating at least one crew must be connected.
- Invalid Crew IDs: If connected crews do not contain valid crew IDs, an error is thrown.
- Invalid JSON: Errors occur if JSON fields (
flowStructure,inputSchema,outputSchema,conditions) contain invalid JSON syntax. - API Request Failures: Network issues or invalid credentials may cause API request failures.
- Error Handling Settings: Misconfiguration of error notification or retry policies might lead to unexpected behavior.
- To resolve errors:
- Ensure crews are properly connected with valid IDs.
- Validate all JSON inputs before running.
- Verify API credentials and network connectivity.
- Adjust error handling and retry settings according to your needs.
- If continuing on error is disabled, any failure will stop the flow execution.