As a core capability of Function AI, workflow orchestration provides a visual, low-code way for developers to design, execute, and manage complex business processes, significantly improving development efficiency and application flexibility. This topic explains the role of workflow orchestration in Function AI and helps you get started.
Benefits
Simplify complex business logic: With a drag-and-drop interface, workflow orchestration enables users, including those without a technical background, to build complex business processes across multiple systems without writing extensive code.
Accelerate the application development cycle: Pre-built components and services allow developers to quickly assemble workflows, enabling rapid prototyping and iteration. This shortens the time from concept to deployment and helps you refine prototypes into effective business processes.
Reliable and stable integration: The workflow orchestration engine provides a unified foundation for reliable and efficient integrations. You can quickly integrate third-party services and custom APIs, add business-dependent APIs into your workflow, and rapidly assemble them.
Improve flexibility and maintainability: Workflow orchestration allows dynamic adjustments to the flow structure, making it easy to adapt to changing business requirements and enhance application resilience. The visual design improves the maintainability of business processes and reduces security and compliance audit risks.
Promote team collaboration: The visual nature of workflow design facilitates communication and understanding among team members, making it easier for individuals in different roles to participate in the design and optimization process.
Standardize and automate processes: A unified design standard and an automated execution mechanism ensure the consistency and efficiency of business processes. This reduces human error and improves overall operational efficiency.
Step 1: Access the console
Log on to the Function AI console. Click the target project. On the project details page, click Create Service in the upper-left corner, and then select workflow orchestration to go to the service creation page.
Step 2: Select a flow mode
On the page for creating a workflow orchestration service, select a region and a flow mode, and then click Save and Enter CloudFlow Studio.
Workflow orchestration is powered by CloudFlow. The following table describes the differences between the standard and express modes supported by CloudFlow.
Metric | Standard mode | Express mode |
Maximum execution duration | 1 year | 5 minutes |
Workflow start rate | 100 QPS | The default rate is 1,000 queries per second (QPS). To request a higher limit, submit a ticket. |
Concurrent executions | 10,000 | The default limit is 10,000. To request a higher limit, submit a ticket. |
Billing | You are charged based on the number of state transitions. | Free of charge during the public preview. |
Execution history and observability | Supports API operations such as querying and listing executions. The system records all execution details. | Support for Log Service (SLS) queries is planned. During the public preview, only API queries are supported. |
Execution semantics | Asynchronous execution. Follows at-least-once semantics. Data is never lost, but in some cases, it might be processed more than once. | Synchronous execution. The system automatically retries on errors. You can also implement retries on the client side as needed. |
Service integrations | Supports all integration methods. For more information, see Integration Overview. | Supports all integration methods. For more information, see Integration Overview. |
Integration mode | Supports the following three integration modes. For more information, see Integration Mode.
| Only the RequestComplete mode is supported. |
Step 3: Design the workflow
Design your workflow in CloudFlow Studio. For a detailed description of the CloudFlow Studio interface, see UI Overview.
-
From the left-side navigation pane, drag a state node (API) or a flow node to the canvas. For example, you can use an InvokeFunction API node.
-
CloudFlow supports the following types of flow nodes. These are system control nodes that manage the basic structure of a workflow.
Node type
Description
Use a Pass state as a placeholder to plan the basic structure of your workflow.
Use a Task state to integrate with other services.
Use a Wait state to pause the workflow execution for a specified duration.
Use a Choice state to define different execution paths based on conditions.
Use a Parallel state to execute multiple branches concurrently. These branches share the same input.
Use a Map state to process elements of an array in parallel. Arrays of primitive types are not currently supported.
Use a Succeed state to terminate the workflow and mark it as successful.
Use a Fail state to terminate the workflow and mark it as failed. You can return a custom error message.
-
CloudFlow implements service integrations as Task states. Supported services include a wide range of system integrations and custom extensions.
Integration service type
Description
Function Compute
Invokes a specified function in Function Compute.
CloudFlow
Invokes a specified workflow in CloudFlow.
EventBridge
Publishes an event to a specified event bus in EventBridge.
Object Storage Service
Writes an object to a specified bucket in Object Storage Service (OSS).
Tablestore
Persists various data from a workflow execution to a table in Tablestore.
Simple Message Queue (formerly MNS) (formerly MNS)
Sends a message to a specified topic or queue in Message Service.
Short Message Service
Calls Short Message Service to send an SMS message to a specified phone number.
Qwen large language models
Integrates with the Alibaba Cloud Qwen large language model service.
Custom HTTP integration
Sends an HTTP request to a specified URL.
-
-
Configure node parameters. Click a component on the canvas. The parameter configuration pane appears on the right. Fill in the parameters or select settings as needed.
For example, an InvokeFunction node has four tabs: Basic Configuration, Input Configuration, Output Configuration, and Error Handling. On the Basic Configuration tab, you can set the State Name, view the State Type, configure Invocation Parameters (including the Function and its Version or Alias), and select the Invocation Type (Synchronous Invocation or Asynchronous Invocation).
A key aspect of workflow orchestration is passing data between nodes. Each node in a workflow has an input and an output.
-
Node input: During workflow orchestration, you can use the system expression
$Context.Current.Inputto access the input of the current node. The shorthand expression is$Input. -
Node output: During workflow orchestration, you can use the system expression
$Context.Current.Outputto access the output of the current state. The shorthand expression is$Output. Note that you can use$Outputonly in scopes where the node has produced an output, such as within the OutputConstructor scope.
During workflow orchestration, you often need to transform data for different service integrations. Each node allows you to construct custom input and output payloads by using InputConstructor and OutputConstructor. This flexibility is essential for data passing. When you construct parameters, you can use both constant values and expressions. To use an expression, append
.$to the parameter key. The workflow engine then evaluates the expression on the right.
-
Step 4: Test and debug the workflow
-
Use the built-in debugging feature to run the workflow with simulated data and verify its logic.
To do this, click Execution Input at the bottom of the canvas, enter your input data in JSON format in the panel that appears, and then click Execute.
-
Review the workflow execution logs to locate and fix any issues.
Step 5: Deploy and monitor the workflow
After testing, click Save and Deploy to publish the workflow.
-
On the Monitoring tab, you can track the execution status of workflow instances, collect performance metrics, and promptly identify and resolve runtime issues.
The workflow details page includes four tabs: Execution History, Workflow Definition, Workflow Scheduling, and Monitoring. The Monitoring tab provides three types of monitoring charts: Workflow Executions (which includes curves for started, succeeded, failed, and timed-out executions), Execution Duration (seconds), and State Transitions. You can filter data by time ranges from 1 hour to 14 days.
-
View detailed execution information and event records.
The execution details page includes three tabs: Basic Information, Input and Output, and Workflow Definition. The Basic Information tab displays details such as the execution status, name, start and end times, duration, execution mode, and execution role. At the bottom of the page, you can switch between a graph view and a table view. The graph view shows the execution status of each node (running, succeeded, incomplete, failed, or timed out). In the right-side panel, you can view the node's Input, Output, and Execution Events.
The Execution Events list records the event details for each state node during a workflow execution, including Event type (such as ExecutionStarted, StateEntered, and TaskSucceeded), State name, State type, Event time, and Time from start.
Next steps
-
Continuously adjust and optimize the workflow design based on runtime performance and business feedback.
-
For information about how to execute a flow, see Execute a Flow.