All Products
Search
Document Center

Container Service for Kubernetes:Schedule Dify workflows with XXL-JOB

Last Updated:Jun 23, 2026

Dify workflow applications need scheduling to automate tasks in scenarios such as risk monitoring, data analytics, content generation, and data synchronization. Dify does not provide native scheduling. Integrate XXL-JOB, a distributed task scheduling platform, to schedule and monitor workflow applications and help ensure stable operation.

How it works

XXL-JOB connects to a published Dify workflow through its API. Once configured, XXL-JOB triggers the workflow on your defined schedule, tracks each execution, and alerts on failures or timeouts.

The integration takes three steps:

  1. Create a Dify environment: Create an ACK cluster, install ack-dify, and publish a workflow application.

  2. Create and configure a scheduling instance: Create an XXL-JOB instance, group tasks into an application, and connect to your Dify workflow API.

  3. Test the integration: Run the task once and verify execution details.

Key features

Feature Description
Task support Schedules self-hosted Dify workflows on the public network and Alibaba Cloud internal network
Flexible time configuration Supports cron, fixed_rate, fixed_delay, one_time, and API-based scheduling with second-level precision; includes timezone and custom calendar settings
Enterprise-grade alerts and monitoring Integrates with CloudMonitor for contact and contact group management; supports failure, timeout, and success alerts at task level, plus threshold-based alerts at application and instance levels; notifies via SMS, phone, webhook, and email
Observability and scheduling dashboard Visualizes scheduling trends, success rates, and failure rates at 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, ensure you have:

  • An Alibaba Cloud account with ACK activated and authorized. See Quick creation of an ACK managed cluster.

  • An XXL-JOB scheduling instance (engine version 2.2.0 or later). If not, create one in step 2.

Step 1: Create a Dify environment

1. Deploy the Dify environment

Use one-click deployment to install ack-dify and enable public network access.

Note

This guide uses public network access for demonstration. For production, enable Resource Access Management (RAM) to protect your data.

If you are new to ACK, click One-click deployment to create the runtime environment. This deploys Dify with Helm using the ack-dify template from the ACK App Marketplace.

Important

Before one-click deployment, activate and authorize ACK.

  1. Click One-click deployment. In the Resource Orchestration Service (ROS) bar, select your region (for example, China (Hangzhou)). Configure the cluster Zone, Instance Type, and Instance Password, and check the Security Confirmation box. Keep defaults for other options, then click Create.

  2. Cluster creation takes about 10 minutes. After creation, go to Container Service console > Clusters. Click the cluster name, then go to Workloads > Pods. Set the namespace to dify-system and verify that ack-dify resources are installed.

  3. (Optional) If a Pod is Pending, it may lack a PVC dependency. Create a default CNFS file system and NAS StorageClass for the cluster. See Manage NAS file systems using CNFS (recommended). To troubleshoot Pod issues, see Troubleshoot pod exceptions.

After ack-dify 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 ack-dify and open it in your browser.

image

3. Register the Dify service

On the Dify setup page, configure an admin account with email, username, and password.

image

4. Create a Dify workflow application

Import the sample dify-flow.yml into Dify to quickly build and publish a workflow for testing.

Important

XXL-JOB supports only Dify workflow applications, not chat-type applications.

image

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. Verify the engine version is 2.2.0 or later. Click Buy Now.

  • Region: Must match the Dify cluster region.

  • Instance Name: For example, Dify-demo.

  • Virtual Private Cloud (VPC) ID: Must match the Dify cluster VPC.

image

2. Create an application

Applications group related tasks into independent scheduling units.

On the XXL-JOB instance page, click Task Management for the target instance. In the left navigation pane, select Application Management, then click Create Application.

  • AppName: For example, Dify-AppName.

  • Name: For example, Dify-AppName.

  • AccessToken: Auto-generated.

image

3. Create a task

A task defines the business logic to schedule. Bind it to a task executor registered with the application's AppName.

Note

Create the application before creating a task. Without one, the executor cannot register.

  • Task Name: For example, Dify-test.

  • Associated Applications: Select the application you created, such as Dify-AppName.

  • Job Type: Dify workflow.

  • Other parameters: Keep defaults.

image

4. Configure task parameters

After publishing the Dify workflow, click API Access to get the task parameters.

  • Endpoint: The Dify workflow API server.

  • API Key: The unique API key for this workflow.

  • Input: Workflow input in JSON format. Example:

    {"input_text": "what is your name"}

image

Step 3: Test the integration

1. Run a test task

Go to Task Management and click Run Once to trigger the task and verify scheduling.

image

2. View scheduling details

Go to Execution List and click Details to confirm successful execution.

image.png

3. Review execution details

Click Details to view:

  • Basic information

  • Input and Output

  • Node Track: Drill down into loops, iterations, and conditional branches for detailed node information.

image.png

Disclaimer

Dify on ACK is a Helm-based deployment that adapts the open-source Dify project for the 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 open-source community updates and proactively fix issues to ensure the stability and security of your Dify deployment.