Skip to main content

Workflow creation and configuration

This chapter will introduce how to configure a simple workflow. The created workflow supports triggering via sdk, accepts parameters, and returns after processing is completed.

Prepare the Environment

This case is completed in the WeChat Mini Program Developer IDE and depends on a provisioned Cloud Development environment with corresponding workflow capabilities.

Before proceeding with subsequent configurations, ensure that WeChat Cloud Development has been activated and the workflow capability is enabled.

Cloud Development Environment

Workflow creation and configuration

Creating a new workflow and configuring triggers in WeChat IDE

Create a blank workflow through the entry in the developer IDE, and select the trigger method as "via component or invocation behavior".

Creating a Workflow

Blank Workflow

trigger

Configuring Logic Nodes

Add a custom code node after the trigger node to process passed parameters via code.

Custom Code Node

The custom code is edited as follows:

const param = manualTrigger.output
console.log(param)
var a = param["a"]
var b = param["b"]
return a+b

Custom Code Editing

Test Workflow

To initiate debugging for the workflow, the debugging input parameters can be set as follows:

{
"a":2
"b":3
}

Debugging Workflow

After configuring the debugging input parameters, initiate workflow debugging and view the execution results.

Debugging Results

Debugging Results

Publish Workflow

After the workflow configuration is completed and saved, proceed to publish it and confirm that it has been successfully published.

Later, you can view the operation status of the published version through the log interface within the workflow.

Publishing a Workflow