Coze icon

Coze

Interact with Coze AI platform

Overview

This node integrates with the Coze AI platform, allowing users to run published workflows hosted on Coze. Specifically, the Workflow - Run operation triggers a specified workflow by its ID, optionally passing input parameters, associating it with a bot and application, and controlling whether the execution is asynchronous.

Typical use cases include:

  • Automating complex processes defined in Coze workflows from within n8n.
  • Triggering AI-driven workflows that may involve database or variable nodes requiring a bot context.
  • Running workflows with dynamic input parameters and extra contextual data such as geolocation or user identifiers.
  • Executing workflows asynchronously for long-running tasks (available on professional plans and above).

Example: A user wants to start a customer support workflow in Coze when a new ticket arrives in n8n, passing ticket details as parameters and associating the run with a specific bot for personalized handling.

Properties

Name Meaning
Authentication Method of authenticating API requests to Coze. Options: "Service Token" or "OAuth2".
Workflow ID The unique identifier of the published workflow to run. This is required.
Parameters JSON object containing input parameters for the workflow's start node. Supports file parameters as well.
Bot ID Identifier of the bot to associate with the workflow run. Required for workflows involving database or variable nodes.
Extra Data Additional JSON fields (e.g., latitude, longitude, user_id) to provide extra context to the workflow execution.
Async Run Boolean flag indicating whether to run the workflow asynchronously. Requires a professional plan or higher.
App ID Identifier of the application associated with this workflow run.

Output

The node outputs an array of JSON objects representing the response(s) from the Coze API after attempting to run the workflow(s). Each item corresponds to one input item processed.

  • The json output contains the API response data related to the workflow execution result.
  • If multiple results are returned, they are flattened into the output array.
  • No binary data output is indicated for this operation.

Dependencies

  • Requires valid authentication credentials for the Coze API, either via a service token or OAuth2.
  • Needs network access to https://api.coze.cn.
  • For asynchronous runs, a professional plan or higher subscription on Coze is necessary.
  • Properly published workflows on Coze must exist and be accessible by the provided credentials.
  • Optional bot and app IDs require those entities to be configured in Coze.

Troubleshooting

  • Common issues:

    • Missing or invalid workflow ID will cause the API call to fail.
    • Providing a bot ID when not required or omitting it when required (e.g., workflows with database nodes) can lead to errors.
    • Insufficient permissions or expired tokens will result in authentication failures.
    • Attempting asynchronous runs without the appropriate plan will be rejected by the API.
  • Error messages:

    • "Workflow not found": Verify the workflow ID is correct and the workflow is published.
    • "Authentication failed": Check that the API key or OAuth2 token is valid and has not expired.
    • "Bot ID required": Provide a valid bot ID if the workflow requires it.
    • "Async run not supported": Upgrade to a professional plan to enable asynchronous execution.
  • To resolve errors, ensure all required properties are correctly set, credentials are valid, and the workflow exists and is published.

Links and References

Discussion