Dify workflows need scheduling for use cases such as risk monitoring, data analytics, content generation, and data synchronization. Dify does not natively support scheduling. This guide shows how to integrate XXL-JOB, a distributed task scheduling system, to schedule and monitor Dify workflow applications and keep them running reliably.
How it works
XXL-JOB connects to a published Dify workflow application through its API. Once configured, XXL-JOB triggers the workflow on your defined schedule, tracks each execution, and sends alerts when failures or timeouts occur.
The integration takes three steps:
-
Create a Dify environment: Create a Container Service for Kubernetes (ACK) cluster, install the ack-dify component, and publish a workflow application.
-
Create and configure a scheduling instance: Create an XXL-JOB scheduling instance, group tasks into an application, and connect the task to your Dify workflow API.
-
Test the integration: Run the task once and verify the execution details.
Key features
| Feature | Description |
|---|---|
| Task support | Schedules self-hosted Dify workflows on the public network and in an Alibaba Cloud internal network environment |
| Flexible time configuration | Supports cron, fixed_rate, fixed_delay, one_time, and API-based scheduling with second-level precision; supports timezone settings and custom calendars |
| Alerts and monitoring | Integrates with CloudMonitor for contact and contact group management; supports failure, timeout, and success alerts at the task level, and threshold-based alerts at the application and instance levels; notifies via SMS, phone, webhook, and email |
| Scheduling dashboard | Visualizes scheduling trends, success rate, and failure rate at the instance and application levels |
| Execution history | Records status, basic information, input and output parameters, duration, and token usage for each execution |
| Event tracking | Logs workflow-level and node-level events for each schedule; supports drill-down into loops, iterations, and conditional branches |
Prerequisites
Before you begin, make sure you have:
-
An Alibaba Cloud account with ACK activated and authorized. For details, see Quick creation of an ACK managed cluster.
-
An XXL-JOB scheduling instance (engine version 2.2.0 or later). If you do not have one, create it in step 2.
Step 1: Create a Dify environment
|
1. Deploy the Dify environment To install the ack-dify component and enable public network access for the Dify service, use one-click deployment for a Dify environment. Note
This guide uses public network access for demonstration purposes. For production environments, enable Resource Access Management (RAM) to protect your application data. If you are new to ACK clusters, click One-click deployment to create the necessary runtime environment. This solution uses the ack-dify application template from the ACK App Marketplace to deploy a Dify application with Helm, meeting development and testing needs. Important
Before using one-click deployment, activate and authorize the Container Service for Kubernetes (ACK) cluster. For details, see Quick creation of an ACK managed cluster.
Once the ack-dify component is installed, proceed to the next step. |
|
|
2. View the external IP address Go to Network > Services > ack-dify and set the namespace to dify-system. Copy the External IP of the ack-dify service and open it in your browser. |
|
|
3. Register the Dify service On the Dify setup page, follow the on-screen instructions to configure an admin account with an email address, username, and password. |
|
|
4. Create a Dify workflow application Import the sample file dify-flow.yml into Dify to quickly build and publish a workflow application for the scheduling test. Important
XXL-JOB supports only Dify workflow applications. Chat-type applications are not supported. |
|
Step 2: Create and configure a scheduling instance
|
1. Create an instance Log on to the XXL-JOB console, select a Region from the top menu bar, and set the Instance Name and VPC ID. Make sure the engine version is 2.2.0 or later. Click Buy Now. |
|
|
2. Create an application Applications logically group tasks. Each application acts as an independent task execution unit, making it easier to view, configure, and schedule tasks. On the XXL-JOB instance page, find the target instance and click Task Management in the Actions column. In the left navigation pane, select Application Management, then click Create Application.
|
|
|
3. Create a task A task is the specific unit of business logic to be scheduled. After you create an application, bind it to a task executor. Once registered with the application via its AppName, the executor can run tasks under that application. Note
Create the application before creating a task. Without an application, the executor cannot register and tasks cannot run.
|
|
|
4. Configure task parameters After publishing the Dify workflow application, click API Access to get the required task parameters.
|
|
Step 3: Test the integration
|
1. Run a test task Go to Task Management and click Run Once to trigger the task immediately and verify that the scheduling function is working. |
|
|
2. View scheduling details Go to Execution List and click Details to confirm the task completed successfully and review its execution record. |
|
|
3. Review execution details Click Details to view:
|
|
Disclaimer
Dify on ACK is a Helm deployment solution that adapts the open-source Dify project for the Alibaba Cloud ACK environment, enabling rapid deployment. ACK does not guarantee the operation of the Dify application itself or its compatibility with other ecosystem components, such as plugins and databases. ACK does not provide compensation or other commercial services for business losses caused by defects in Dify or its ecosystem components. Follow updates from the open-source community and proactively fix issues in the open-source software to ensure the stability and security of your Dify deployment.









