This guide explains how to invoke Alibaba Cloud Bailian workflow applications using either the DashScope API or the OpenAI Responses API-compatible interface to pass custom parameters.
How It Works
When invoking a workflow application, dynamic parameters are uniformly encapsulated within the input object, which contains two key fields:
prompt: Contains the user's primary input. This content is automatically mapped to the built-in variable{{query}}in the workflow—no manual definition required.biz_params: A key-value dictionary for passing custom business parameters (e.g.,{"city": "Hangzhou"}). These parameters must be pre-defined in the workflow’s Start Node, after which they become globally available and can be referenced anywhere in the workflow—including in LLM node prompts—using the syntax{{parameter_name}}.
How to Use
Prerequisites
- You must have configured your API Key and set it as an environment variable. If using the DashScope SDK, ensure it is installed.
- Application ID (
YOUR_APP_ID): Navigate to the Application Management page in the Bailian console to view your application list and retrieve the ID from the target application card.
Getting Started
This guide uses “querying administrative divisions by city name” as an example to demonstrate how to invoke a workflow application and pass custom parameters.
Step 1: Configure the Workflow
- Go to the Application Management page in the Bailian console and create or edit a Workflow Application.
- In the Variables configuration panel of the Start Node, add a custom parameter—for example, a String-type variable named
city. - Reference the custom variable in prompts of downstream nodes (e.g., LLM nodes). Example prompt:
Query the administrative divisions of {{city}}. The user's question is: {{query}}. - Publish the application.
Step 2: Make the API Call
Pass the city parameter via the biz_params field and the query via the prompt field. When using the OpenAI Responses API-compatible interface, extend biz_params using the extra_body field.