Skip to main content
工作流应用

Overview

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.

Practical Example

Example 1: Identifying Fraudulent Messages

This example demonstrates creating a workflow application that determines whether an SMS message contains signs of telecom fraud. It uses three nodes: Start, Large Language Model (LLM), and End.
1

Create a Workflow Application

Navigate to the Application Management page, click Create Application > Workflow Application, enter an Application Name, then click Create Now.
2

Add an LLM Node

Drag the Large Language Model node from the left sidebar onto the canvas. In its configuration panel, set the following parameters:
  • Model Configuration: Select Qwen-Plus-latest
  • System Prompt:
Analyze and determine whether the provided message exhibits signs of fraud. Answer definitively: does this message show indications of fraud?
Processing Requirements: Carefully review the message content, focusing on keywords and typical fraud patterns—such as urgent fund transfers, requests for personal information, or promises of unrealistic benefits.
Steps:
1. Identify key elements in the message, including but not limited to sender identity, requested actions, promised rewards, and any urgency-inducing language.
2. Compare against known fraud characteristics—checking for similar tactics or linguistic patterns.
3. Assess overall plausibility: do the requests align with common logic and standard procedures?
4. If the message includes links or attachments, do *not* click or download them—avoid potential security risks—and warn users about associated dangers.
Output Format: Clearly state whether the message exhibits fraud indicators, and briefly explain the reasoning.
  • User Prompt: Determine whether the message "${sys.query}" is suspected of being fraudulent.
After completing the configuration, close the panel. Then connect the Start node to the Large Language Model node.
3

Connect the End Node

Connect the LLM node to the End node. Click the End node, open its configuration panel, and type / in the editor to insert the variable Large Language Model 1/result. Leave all other parameters at their default values.The final workflow consists of three sequentially connected nodes: StartLarge Language Model 1End.
4

Test the Workflow

Click Test in the top-right corner. Enter Your package has been stored at the delivery station for several days without pickup—please collect it at your earliest convenience, then run the workflow to view the output.Next, test with You've won 1 million RMB—please check your messages, to verify detection effectiveness.
5

Publish the Application

If the workflow functions correctly, click Publish in the top-right corner to make it available for subsequent API calls.

Node Types

Workflows are composed of various functional nodes.

Basic Nodes

AI Nodes

Tool Nodes

Data Processing Nodes

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

  1. You have obtained an API Key and configured it in your environment variables.
  2. You have created a workflow application and retrieved its APP_ID from the application card on the Application Management page.
  3. If invoking via the DashScope SDK, ensure the DashScope SDK is installed.

Quick Start

import os
from http import HTTPStatus
from dashscope import Application

response = Application.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    app_id='APP_ID',  # Replace with your actual application ID
    prompt='Who are you?')

if response.status_code != HTTPStatus.OK:
    print(f'request_id={response.request_id}')
    print(f'code={response.status_code}')
    print(f'message={response.message}')
else:
    print(response.output.text)

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.
import os
from http import HTTPStatus
from dashscope import Application

def call_with_session():
    response = Application.call(
        api_key=os.getenv("DASHSCOPE_API_KEY"),
        app_id='APP_ID',
        prompt='Who are you?')

    if response.status_code != HTTPStatus.OK:
        print(f'request_id={response.request_id}')
        print(f'code={response.status_code}')
        print(f'message={response.message}')
        return response

    responseNext = Application.call(
                api_key=os.getenv("DASHSCOPE_API_KEY"),
                app_id='APP_ID',
                prompt='What skills do you have?',
                session_id=response.output.session_id)

    if responseNext.status_code != HTTPStatus.OK:
        print(f'request_id={responseNext.request_id}')
        print(f'code={responseNext.status_code}')
        print(f'message={responseNext.message}')
    else:
        print('%s\n session_id=%s\n' % (responseNext.output.text, responseNext.output.session_id))

if __name__ == '__main__':
    call_with_session()

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}}.
For detailed usage instructions, see Passing Custom Parameters via API.