Run a Coze Workflow
Coze is a workflow automation platform that can be used to build many kinds of tasks. ConsoleX can call Coze workflows as tools, which expands what models can do in practical scenarios.
Basic steps
- Create a workflow in Coze and publish it. The workflow should start with a Start node and end with an End node. On Coze.com, workflow calls use the shared base URL
https://api.coze.com/v1/workflows/run. To distinguish different workflows, append the workflow ID after a#, like this:
https://api.coze.com/v1/workflows/run#{workflow_id}
The End node should return response text and assemble a JSON object whose fields become the tool result.
- In ConsoleX AI, create a tool and define a JSON Schema that matches the input parameters expected by the Coze workflow. The format follows the OpenAI tool schema standard.
- Enable tool calling, choose
POST, set the interface type to Coze, and use the full workflow URL—including the workflow ID—as the endpoint. - Add the tool to a conversation. The model will then be able to call the Coze workflow based on the tool description and input schema.
Notes
- The tool JSON Schema must match the workflow input parameters, otherwise the model may not call the workflow correctly. Use Coze’s run history for debugging.
- A Coze workflow must be published before it can be called.
- The international and China versions of Coze use different workflow endpoints:
- International:
https://api.coze.com/v1/workflows/run - China:
https://api.coze.cn/v1/workflows/run
- International:
Common issue: auth tokens
All Coze workflows use a unified token-based authentication system. Create a token in the Authorization area and make sure the required permissions are granted. Note that Coze tokens currently expire and can only be used for up to 30 days, so they need to be refreshed periodically.