N8N Tools - CrewAI Task icon

N8N Tools - CrewAI Task

Create and manage CrewAI tasks with detailed specifications

Overview

This node allows users to create and manage tasks for CrewAI agents by specifying detailed instructions and expected outputs. It is designed to facilitate task delegation to AI agents, either by connecting an Agent node or selecting an agent from a list. The node supports advanced options such as output formatting, execution context, asynchronous execution, and callback URLs.

Common scenarios:

  • Automating complex workflows where specific AI agents perform tasks based on detailed descriptions.
  • Delegating content generation, data processing, or other AI-driven operations to selected agents.
  • Integrating AI task execution within larger automation pipelines with control over execution parameters and output formats.

Practical example:
A user wants to generate a marketing email draft. They provide a detailed description of the email's purpose and expected output format (e.g., Markdown). They select an appropriate AI agent either by connecting an Agent node or choosing from a dropdown. The node sends this task to the agent and returns the generated email content in the specified format.

Properties

Name Meaning
Description Detailed description of what the task should accomplish. This is a required field that guides the agent on the task specifics.
Expected Output Clear description of the expected task output. Defines what the user expects as a result from the agent. Required.
Agent Selection Method How to assign an agent to this task. Options:
- Connect Agent Node: Use an Agent node connected to the Agent input.
- Select from List: Choose an agent from a dropdown list loaded dynamically.
Agent Select the agent responsible for this task when "Select from List" method is chosen. The list is dynamically loaded from available agents. Required if selection method is "select".
Advanced Options Collection of optional settings:
- Output Format: Expected format of the task output (Text, JSON, Markdown, CSV, XML). Default is Text.
- Context: Additional context information for task execution.
- Max Execution Time (seconds): Maximum allowed time for task execution (default 600 seconds).
- Async Execution: Whether to run the task asynchronously (boolean).
- Output File Path: Optional file path to save the task output.
- Callback URL: Webhook URL to receive notifications upon task completion.
Report Issue Notice with links to report bugs or get help.
Request Feature Notice with links to request new features or enhancements.

Output

The node outputs the response from the CrewAI API after creating the task. The output is structured as JSON and includes all relevant details returned by the API about the created task.

  • The json output contains the full API response object representing the created task.
  • If the task creation fails and "Continue On Fail" is enabled, the output will contain an error message describing the failure.
  • No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the CrewAI API.
  • The node depends on the external CrewAI service to create and manage tasks.
  • The node dynamically loads available agents via an API call to /agents.
  • Proper network connectivity and valid credentials are necessary for successful operation.

Troubleshooting

  • Common issues:

    • Missing required fields such as Description, Expected Output, or Agent ID will cause validation errors.
    • Selecting "Connect Agent Node" without connecting a valid Agent node to the input may result in missing agent information.
    • Network or authentication failures when calling the CrewAI API can cause task creation to fail.
  • Error messages:

    • Validation errors indicating missing required fields: Ensure all mandatory properties are filled.
    • API request errors: Check API key validity, network connection, and CrewAI service status.
    • Loading agents failure: Verify API credentials and that the CrewAI service is reachable.
  • Resolutions:

    • Double-check all required inputs before execution.
    • Confirm that the correct agent is selected or connected.
    • Review API credentials and permissions.
    • Enable "Continue On Fail" to handle errors gracefully within workflows.

Links and References

Discussion