Workflow application

Updated at:

A workflow breaks down complex tasks into ordered steps to reduce system complexity. In Alibaba Cloud Model Studio, workflows let you combine nodes, such as large models, APIs, and Function Compute, to reduce coding costs.

Application

Why use a workflow application

A workflow breaks down complex tasks into a sequence of steps to reduce system complexity. Creating a workflow application on Model Studio lets you define the execution order, assign responsibilities, and specify dependencies between steps to automate and optimize the process.

Common use cases for workflow applications include:

  • Travel planning: You can use a workflow plugin to select parameters, such as a destination, and automatically generate a travel plan that includes flights, accommodations, and attraction recommendations.
  • Report analysis: For complex datasets, you can combine data processing, analysis, and visualization plugins to generate structured, formatted analysis reports.
  • Customer support: You can use automated workflows to handle customer inquiries, including issue classification, to improve response speed and accuracy.
  • Content creation: You can generate content such as articles and marketing copy. Provide a topic and requirements, and the system automatically generates a draft.
  • Education and training: You can use a workflow to design personalized learning plans with progress tracking and assessments, enabling self-paced learning for students.
  • Medical consultation: Based on patient-entered symptoms, a workflow can combine multiple analytical tools to generate a preliminary assessment or recommend relevant tests to assist doctors with further diagnosis.

Node Types

A workflow is composed of various functional nodes.

Basic Nodes

AI Nodes

Tool Nodes

Data Processing Nodes

Session parameters

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 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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 after the workflow completes.
  • 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.

  1. In the input box, enter your test content and click the Run button to start the test.
  2. 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 view the history of asynchronous tasks in the Task Center.

  1. In the input box, enter your test content and click the Run button to start the test. The system immediately returns a Task ID.
  2. While the asynchronous task is running, the test panel displays an "Executing" status. You can click the Refresh button to refresh the status.
  3. 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.

Audio and video interaction

Alibaba Cloud Bailian lets you publish a workflow as a real-time audio and 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.
  1. Create a workflow by configuring a start node, a large language model node, and an end node so it runs correctly.
  2. In Test > Text Chat, debug the application until it performs as expected.
  3. 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.
  4. In the Audio & Video Settings, configure the parameters, 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.
  5. 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.
  6. 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 your workflow. To view the checklist, click the checklist icon in the upper-right corner of the canvas configuration page.

Release an application

Once an application is released, you can call it via an API or share it as a web page with RAM users in the same main account. To do so, click the Publish button in the upper-right corner of the agent application management page.

Call via API

On the Publish Channel tab of your workflow application, click View API next to API to learn how to call the agent application by using an API.

Note: You must replace DASHSCOPE_API_KEY with your API key to call the API.

For FAQs and information about API calls, see the following topics:

Currently, you cannot call the Xiyan service from a workflow. Instead, use an API node to call a custom API service.

The timeout for API calls is 600 seconds and cannot be changed. If a timeout may occur, consider the following solutions:

  • Use asynchronous mode: In this mode, the system returns a task ID. You can then use the task ID to query the result, which avoids the synchronous timeout limit.
  • Split the task: Break down the task into multiple steps, or process batch data in smaller chunks to prevent a single execution from timing out.

Release as a component

You can release a workflow application as a component for use in other agents or workflows. For detailed instructions, see Release as a component.

Other invocation methods

For other sharing methods, see Share an application.

Import or export a workflow

  1. 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.

  2. Import a Dify workflow

    Model Studio supports one-click import of Dify workflows for easy migration and reuse.

    1. Click the more icon at the top of the workflow page and select Import Dify DSL.
    2. Adjust the parameters for each node. The node compatibility details are as follows:
    Dify nodeMapped Model Studio nodeCompatibility
    startstartsys.query maps to query; sys.dialogue_count maps to maximum memory turns.
    LLMLLMModel: Model Studio clears the model field for unsupported models, requiring you to select one manually. Supported models are fully compatible. Prompt: Dify's System prompt maps to the main prompt in Model Studio, while its User prompt maps to the user prompt. Vision capability: fully compatible. Context: Model Studio incorporates the raw fields from Dify's context directly into its system prompt.
    knowledge retrievalknowledge baseInput: Model Studio consistently uses the content field as the input. Knowledge base: cleared after import; you must manually associate a knowledge base. Retrieval settings: Dify's Top-k maps to the number of retrieved fragments.
    Direct Replyoutput nodeFully compatible.
    agentNoneOnly the name is retained. You must click the node and select a specific Model Studio node as a replacement.
    Question Classifierintent classificationModel Studio clears the model field for unsupported models, requiring you to select one manually. Supported models are fully compatible.
    Iterationbatch processingInput maps to Batch Array; output variable maps to Output Variable.
    looploopFully compatible.
    code executionscriptModel Studio distinguishes between Python and JavaScript scripts.
    Template TransformNoneNot compatible. Model Studio generates a custom node.
    Variable AggregatorVariable ProcessingMaps to the Aggregate Groups output mode of the Variable Processing node.
    Document ExtractorNoneNot compatible. Model Studio generates a custom node.
    Variable AssignmentVariable SettingsFully compatible.
    Parameter Extractorparameter extractionModel Studio does not support inference mode. Other features are fully compatible.
    HTTP requestAPIFully compatible, but you must re-authenticate.
    List OperationNoneNot compatible. Model Studio generates a custom node.
    Toolplugin, MCPNot compatible. Model Studio generates a custom node.
    commentNoneNot compatible.
    endendIf a Dify workflow contains multiple end nodes, Model Studio converts them into a single Variable Processing node and a single end node.

Manage workflow versions

  1. 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.
  2. Click Version Management at the top of the page, and 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 at the top to export the DSL of the selected historical version.
  3. 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

  1. How do I write the results of a workflow run to a database?

    Use a script conversion node to write the output from the previous node to a database.

  2. How do I upload files when building a workflow application in Model Studio?

    Add an API node to your workflow application to upload files.

  3. How do I upload images?

    Use a VL model and pass the image URL as a parameter.

  4. Can I use an asynchronous task API within a workflow application?

    The timeout for a workflow application is 600 seconds. Avoid using an asynchronous task API within a workflow.

  5. How can I call the Model Studio workflow API from a frontend application and receive a streaming output?

    Frontend calls are not currently supported.

  6. Why can't I import a standalone .yaml file into a Model Studio workflow?

    Model Studio does not support importing standalone .yaml files. You must provide a compressed package that includes an MD5 file. We recommend regenerating the MD5 if you encounter issues.

  7. Can variable names in Model Studio workflows be in Chinese?

    No, variable names cannot contain Chinese characters.

  8. How is conversation history stored?

    Workflow applications store data for only one month. You must save your own conversation history. The session_id is valid for one hour.

Nodes

  1. Why does my intent classification node fail when context is enabled?

    If you enable context for an intent classification node, the variable that you pass to it must be a list.

  2. Why does my API node fail when I use streaming output?

    The API node within a workflow does not support streaming output. However, streaming output is supported by the underlying HTTP API.

  3. 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 to reduce response time.
    • Optimize script logic: If the conditional logic involves a custom script, optimize the script by reducing unnecessary loops or redundant data processing to improve performance.
    • Run batch tests: Measure the average response time of your workflow to identify performance bottlenecks under specific conditions.
  4. How do I stream the reasoning process from a large model node?

    You need to add a text conversion node after the large model node, configure the reasoning_content variable, and enable Result Return. The end node must receive the result.

  5. 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, you can select the output of the large model node as the final output resultList in the batch node's configuration.

    See Parameter passing for applications.

  6. Why does my API node return no result or fail to pass parameters?

    Verify that your API key and Base URL are correct. Ensure that the input parameters are configured correctly, and adjust the field input types if necessary. Use Model Observation to view model usage details.

  7. How do I resolve issues when accessing Excel data from a knowledge base?

    You cannot directly access local files. Use MCP to access local resources. You must manually process the output from a knowledge base node. We recommend adding a large model node to convert the output to a table format before passing it to a script node for further processing.