Skip to main content

Run a Dify Workflow

Dify is a powerful workflow automation platform for building multi-step automations. ConsoleX can call Dify workflows as tools, which lets models handle more complex tasks. Dify workflows can be created either on Dify Cloud or in a self-hosted deployment.

Basic steps

  1. Create and publish a workflow in Dify. All workflows in a Dify workspace share the same API server base URL, which you will use as the tool function URL in ConsoleX. Create an API key for the workflow. Variables returned by the workflow’s end node become the tool result.
  2. In ConsoleX AI, create a tool and define its JSON Schema so it matches the workflow input parameters. The format follows the OpenAI tool schema standard. You can use examples or let AI help generate it.
  3. Enable tool calling, choose either GET or POST, set the interface type to Dify, enter the API server URL from step 1, and paste the API key into the URL/API key field. Choose the return processing mode that fits your workflow, then save.
  4. Add the tool to a conversation. The model can now call the Dify workflow automatically based on the tool description and input schema.

Example workflow

Here is a sample Dify weather workflow you can save locally and import into Dify:

Weather workflow

Notes

  1. The tool JSON Schema must match the workflow input parameters. Otherwise the model will not call the workflow correctly. You can inspect call details in Dify’s run history.
  2. The workflow must be published before it can be called from ConsoleX.