Workflow applications break down complex tasks into a series of sequentially executed steps to reduce system complexity. In Alibaba Cloud Bailian, you can combine large language models (LLMs), APIs, Function Compute nodes, and other components within workflows—significantly lowering development overhead. This article explains how to create a workflow application.
Application Overview
Why Use Workflow Applications?
A workflow is a method for decomposing complex tasks into a sequence of ordered steps—designed to simplify system complexity and improve operational efficiency. In modern software development and business process management, workflow applications have become increasingly essential. By building workflow applications on the Alibaba Cloud Bailian platform, you can clearly define task execution order, responsibility assignment, and inter-step dependencies—enabling automation and optimization.
Workflow applications support numerous use cases, including:
- Travel Planning: Users select parameters such as destination via a workflow plugin, and the system automatically generates a comprehensive travel plan—including flight bookings, accommodations, and attraction recommendations.
- Report Analysis: For complex datasets, workflows combine data processing, analytical, and visualization plugins to generate structured, formatted analytical reports tailored to diverse business needs.
- Customer Support: Automated workflows handle customer inquiries—including issue classification—to accelerate response times and improve accuracy.
- Content Creation: Workflows generate articles, marketing copy, and other content types. Users only need to provide a topic and requirements; the system produces compliant drafts automatically.
- Education & Training: Workflows design personalized learning paths—including progress tracking and assessments—to enable self-directed student learning.
- Medical Triage: Based on patient-reported symptoms, workflows integrate multiple analytical tools to produce preliminary diagnoses or recommend relevant tests—assisting physicians in further evaluation.
Node Types
A workflow is composed of functional nodes. Start and End nodes are intrinsic to the canvas and exist at both ends of the flow. Add other nodes from the categorized library on the left:
- Basic Nodes
- Tool Nodes
- Logic Nodes
- Variable Nodes
- Data Nodes
- Agent Nodes
- Cloud Resource Nodes
Session Variables
A session variable acts as a global variable, storing parameters throughout the workflow's lifecycle to be referenced by any node. Click the session variable icon in the upper-right corner of the canvas configuration page to configure it.
Test the Application
After you configure the workflow, you can use the test feature to verify that it runs as expected. Click the Test button in the upper-right corner to open the test panel. The test panel offers multiple test modes for different use cases.
Text Conversation
Text conversation is the default test mode. It preserves the conversation history and supports continuous, multi-turn conversations.
- From the drop-down list at the top of the test panel, select text conversation mode (selected by default). If the workflow contains custom variables, enter their values in the parameter configuration area.
- In the input box, enter your test content (text and file attachments are supported), and then click the Send button or press Enter to run the test.
- Review the test results. You can click a node to view its detailed input and output, or switch the output format between Text and JSON.
- To continue the conversation, enter your next turn in the input box and send it. To start a new conversation, click the Clear All button.
Text Generation
The text generation mode is for single-turn interactions. Each test is independent, and the conversation history is not preserved. It supports two modes:
- Synchronous run: For simple, fast tasks. Returns the result immediately upon completion.
- Asynchronous run: For complex, time-consuming tasks. Returns a Task ID that you can use to query the result.
Synchronous Run
In synchronous run mode, the workflow executes immediately and returns the result directly upon completion.
- In the input box, enter your test content and click the Run button to start the test.
- After the workflow finishes running, switch to the Result tab to view the output. You can click a node to view its detailed input and output, or switch the output format between Text and JSON.
Asynchronous Run
In asynchronous run mode, the workflow executes in the background. The system immediately returns a Task ID, which you can use to query the result. You can also view the history of asynchronous tasks in the Task Center.
- In the input box, enter your test content and click the Run button to start the test. The system immediately returns a Task ID.
- While the asynchronous task is running, the test panel displays an "Executing" status. You can click the Refresh button to refresh the status.
- After the task is complete, view the output on the Result tab. The output includes an "Async" tag and the Task ID. You can click a node to view its detailed input and output, or switch the output format between Text and JSON.
Voice Interaction and Video Interaction
Voice Interaction and Video Interaction are two independent test modes in the test panel. You can publish a workflow application as a real-time voice or video conversation application. It provides a convenient debugging window where you can quickly test a demo on an H5 or mobile app. You can also integrate the application into your web, iOS, or Android applications using an audio and video SDK.
- We do not recommend using models with high latency for real-time audio and video conversations, as it may affect the conversation experience. Examples include the DeepSeek-R1 and QwQ series models.
- The DeepSeek V3 model does not support video chat.
- Create a workflow by configuring a Start node, a large language model node, and an End node.
- In Test > Text Chat, debug the application until it performs as expected.
- After you are satisfied with the text conversation performance, switch to Interactive voice response or Video Interaction mode. Then, click Configure to set up the API key to call the application.
- In Audio & Video Settings, configure the parameters, and then click Call to debug the audio and video interaction. Under speech-to-text, you can select the language; under text-to-speech, you can select the voice model and timbre.
- Once you are satisfied with the test results, click the Try button in the upper-right corner to generate a temporary QR code for testing. You can scan the QR code with WeChat, DingTalk, or a mobile browser to test the interaction. The QR code is valid for 24 hours.
- After confirming the performance, click the Publish button to publish the application. Then, go to the Publish Channel, activate Intelligent Media Service, grant SLR authorization, and create an interactive agent.
Checklist
The checklist lists the required configurations for ensuring your workflow runs successfully. To view the checklist, click the checklist icon in the upper-right corner of the canvas configuration page.
Publishing and Invocation
After configuring and testing your workflow, click Publish in the top-right corner to deploy the application. Once published, it can be invoked via API.
To invoke using the Responses API, see Responses API Invocation.
Prerequisites
- You have obtained an API Key and configured it in your environment variables.
- You have created a workflow application and retrieved its
APP_IDfrom the application card on the Application Management page. - If invoking via the DashScope SDK, ensure the DashScope SDK is installed.
Quick Start
Node Execution Status
The output.thoughts[] array in the response returns execution information for each node, in execution order. The response field of each element is a JSON string containing the following fields:
| Field | Type | Description |
|---|---|---|
| nodeId | string | Node ID. |
| nodeName | string | Node name. |
| nodeType | string | Node type, such as Start, LLM, or Script. |
| nodeStatus | string | Node execution status. See the table below for valid values. |
| nodeResult | string | Node output, as a JSON string. Not returned for nodes without output, such as the Start node. |
| nodeExecTime | string | Node execution duration, such as 1167ms. Not returned while the node is still running. |
nodeStatus:
| Value | Description |
|---|---|
| success | The node ran successfully. |
| fail | The node failed. |
| skip | The node was skipped and did not run. |
| executing | The node is running and nodeResult is empty. In streaming mode, a node first returns executing, then returns its final status once complete. |
Multi-turn Conversations
Compared to single-turn interactions, multi-turn conversations allow the LLM to reference prior dialogue history—making interactions more natural and aligned with real-world communication.
Passing Custom Parameters
When invoking a workflow application, dynamic parameters are uniformly encapsulated in the input object, which contains two key fields:
prompt: Carries the user’s primary input. This content is automatically mapped to the built-in workflow variable{{query}}, requiring no manual definition.biz_params: Passes custom business parameters as key-value pairs (e.g.,{"city": "Hangzhou"}). These must be pre-declared in the workflow’s Start node, after which they become globally accessible across all nodes via{{parameter_name}}.
Import or Export a Workflow
- Import or export a Model Studio workflow Click the more icon at the top of the workflow page and select Export DSL or Import Model Studio DSL.
-
Import a Dify workflow
One-click import of Dify workflows is supported for easy migration and reuse.
- Click the more icon at the top of the workflow page and select Import Dify DSL.
- Adjust the parameters for each node. The node compatibility details are as follows:
Dify node Mapped node Compatibility start start sys.querymaps toquery;sys.dialogue_countmaps to maximum memory turns.LLM LLM Model: unsupported models are cleared and must be selected manually, supported models are fully compatible; Prompt: Dify's System maps to the main prompt, User maps to the user prompt; vision capability is fully compatible; context: the raw fields from Dify's context are incorporated directly into the system prompt. knowledge retrieval knowledge base Input: the contentfield is consistently used as input; knowledge base: cleared after import and must be associated manually; retrieval settings: Dify'sTop-kmaps to the number of retrieved fragments.Direct Reply output node Fully compatible. agent None Only the name is retained. Click the node and select a specific node as a replacement. Question Classifier intent classification Unsupported models are cleared and must be selected manually; supported models are fully compatible. Iteration batch processing Input maps to Batch Array; output variable maps to Output Variable. loop loop Fully compatible. code execution script Python and JavaScript scripts are distinguished. Template Transform None Not compatible. A custom node is generated. Variable Aggregator Variable Processing Maps to the Aggregate Groups output mode of the Variable Processing node. Document Extractor None Not compatible. A custom node is generated. Variable Assignment Variable Settings Fully compatible. Parameter Extractor parameter extraction Inference mode is not supported; other features are fully compatible. HTTP request API Fully compatible, but you must re-authenticate. List Operation None Not compatible. A custom node is generated. Tool plugin, MCP Not compatible. A custom node is generated. comment None Not compatible. end end If a Dify workflow contains multiple end nodes, they are converted into a single Variable Processing node and a single end node.
Manage Workflow Versions
- Click Publish in the top-right corner of the workflow configuration page. In the Publish dialog box, enter version information, such as 1.0.0, and click OK.
- Click Version Management at the top of the page. In the Historical Versions panel, you can view or use different versions of the current workflow application as needed by clicking Overwrite Current Draft or Return to Current Version. You can also click Export DSL for This Version to export the DSL of the selected historical version.
- (Optional) In the Node Library, view or search for nodes.
Delete and Copy Workflow Applications
In My Applications, find a published application card and click the more icon to delete the application, copy its workflow, or modify its application name.
FAQ
Workflow Applications
How do I write the results of a workflow run to a database?
How do I write the results of a workflow run to a database?
How do I upload files?
How do I upload files?
How do I upload images?
How do I upload images?
Can I use an asynchronous task API within a workflow application?
Can I use an asynchronous task API within a workflow application?
How can I call the workflow API from a frontend application and receive a streaming output?
How can I call the workflow API from a frontend application and receive a streaming output?
Why can't I import a standalone .yaml file?
Why can't I import a standalone .yaml file?
Can variable names be in Chinese?
Can variable names be in Chinese?
How is conversation history stored?
How is conversation history stored?
session_id is valid for one hour.Nodes
Why does my intent classification node fail when context is enabled?
Why does my intent classification node fail when context is enabled?
Why does my API node fail when I use streaming output?
Why does my API node fail when I use streaming output?
How do I speed up a slow conditional node?
How do I speed up a slow conditional node?
- Check your workflow configuration: ensure each node, especially the conditional node, is configured correctly. Avoid unnecessarily complex calculations or data processing.
- Optimize script logic: if the conditional logic involves a custom script, optimize it by reducing unnecessary loops or redundant data processing.
- Run batch tests: measure the average response time of your workflow to identify performance bottlenecks under specific conditions.
How do I stream the reasoning process from a large model node?
How do I stream the reasoning process from a large model node?
reasoning_content variable, and enable Result Return. The end node must receive the result.How can I customize the output parameters of a large model node?
How can I customize the output parameters of a large model node?
- Use a script node to process the output: add a script node after the large model node to process its output, convert it to your desired format, or add extra parameters.
- Configure a batch node: if you are using a large model node within a batch node, select the output of the large model node as the final output
resultListin the batch node's configuration.
Why does my API node return no result or fail to pass parameters?
Why does my API node return no result or fail to pass parameters?
How do I resolve issues when accessing Excel data from a knowledge base?
How do I resolve issues when accessing Excel data from a knowledge base?