Create workflow¶
Create a workflow definition in the current workspace. The job will not be started automatically after successful creation.
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-deployments
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Permission requirements depend on the deployment method and the referenced resources. In addition to workflow creation permissions, you may also need permissions to use compute resources and reference resources. Passing in an existing workflow ID cannot complete this POST solely with administrative permissions.
Prepare personal access token and target workspace ID with permission to create workflow. Prepare workflow DSL manually. Prepare accepted workflow candidates in a natural language manner.
Request body¶
First export a YAML containing valid nodes from the workflow editor and save it as workflow.yaml. The following handwritten workflow example reads the file and uses jq to preserve true line breaks in the DSL; please install jq first.
export DSL_YAML="$(cat workflow.yaml)"
The example uses jq to construct the JSON request body. Install jq first and set the required environment variables. Do not JSON encode the variable values again.
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID and the workflow name and DSL in the example with actual values.
One-time run
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-deployments" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg dsl "$DSL_YAML" '{
"name": "daily-import",
"dsl_yaml": $dsl,
"execution_mode": "one_shot"
}')"
Dynamic service
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-deployments" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg dsl "$DSL_YAML" '{
"name": "order-query-service",
"dsl_yaml": $dsl,
"execution_mode": "dynamic_service",
"dynamic_service": {
"service_name": "order-query-service",
"input_schema": "{\"type\":\"object\"}",
"output_schema": "{\"type\":\"object\"}"
}
}')"
Scheduled trigger
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-deployments" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg dsl "$DSL_YAML" '{
"name": "daily-import",
"dsl_yaml": $dsl,
"execution_mode": "cron",
"cron_expression": "0 2 * * *"
}')"
Volume trigger
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-deployments" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg dsl "$DSL_YAML" '{
"name": "volume-import",
"dsl_yaml": $dsl,
"execution_mode": "volume_trigger",
"volume_trigger": {
"volume_id": 1001,
"enabled": true
}
}')"
Natural language candidate deployment
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-deployments" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg TASK_ID "$TASK_ID" --arg ARTIFACT_ID "$ARTIFACT_ID" '
{
"name": "ticket-analysis",
"source_type": "nl2dsl",
"candidate_ref": {
"task_id": $TASK_ID,
"artifact_id": $ARTIFACT_ID
},
"execution_mode": "one_shot",
"default_values": {
"text": "需要处理的文本"
}
}
')"
The handwritten DSL must contain a deployable root node and at least one valid node. An empty chain: [] cannot be deployed.
The natural language generation workflow is deployed using accepted candidate references.
manual_dsl uses DSL, manual_mowl uses workflow objects, and natural language generation uses corresponding candidate definitions. Filling in the existing workflow_id will enter the redeployment process instead of simply creating a new one. Notify configured request headers to use full original values and protect credentials.
The input and output schemas of dynamic services must be provided in JSON text. The run specification text can be omitted, and the result mode defaults to oneshot. Passing JSON syntax does not mean that complete Schema semantic verification has been completed.
name must be provided when creating a workflow. When source_type is omitted, it will be processed as handwritten DSL (manual_dsl). In this case, dsl_yaml must be provided. When using natural language candidates, fill in source_type=nl2dsl and accepted candidate_ref, and do not submit dsl_yaml. Creates a new workflow when workflow_id is omitted. When provided, entering the redeployment branch of an existing workflow still requires creation permissions and target resource permissions. Do not pass runtime_context.
One-time run
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
workflow name. |
|
string or null |
No |
workflow description. |
|
string or null |
No |
Fill in |
|
string or null |
No |
Cron expressions. |
|
string or null |
No |
Required when writing DSL by hand. Natural language candidates are not passed during deployment. |
|
string or null |
No |
The associated computing resource ID. |
|
object or null |
No |
Run-time input form configuration. |
|
string or null |
No |
Title text. |
|
string or null |
No |
Description of the current object. |
|
array of object or null |
No |
Field definition. |
|
string or null |
No |
Form field ID used to run input and layout associations. |
|
string or null |
No |
Show labels. |
|
string or null |
No |
Description of the current object. |
|
string or null |
No |
Input control type. |
|
string or null |
No |
JSON type. |
|
string or null |
No |
Model type label. |
|
boolean or null |
No |
Is it required? |
|
JSON value or null |
No |
Default value. |
|
boolean or null |
No |
Is there a default value? |
|
string or null |
No |
Enter the prompt. |
|
string or null |
No |
String matching pattern. |
|
string or null |
No |
Field path in run configuration. |
|
string or null |
No |
The block it belongs to. |
|
string or null |
No |
The group it belongs to. |
|
string or null |
No |
Value when enabled. |
|
string or null |
No |
value when closed. |
|
boolean or null |
No |
Whether to hide. |
|
boolean or null |
No |
Whether it is read-only. |
|
boolean or null |
No |
Whether it contains sensitive values. |
|
array of object or null |
No |
Optional. |
|
string or null |
No |
Show labels. |
|
JSON value or null |
No |
Value. |
|
string or null |
No |
Description of the current object. |
|
number or null |
No |
minimum value. |
|
number or null |
No |
maximum value. |
|
array of string or null |
No |
Allowed file types. |
|
string or null |
No |
Resource type. |
|
object or null |
No |
Show conditions. |
|
string or null |
No |
Form field ID used to run input and layout associations. |
|
JSON value or null |
No |
Value. |
|
string or object or null |
No |
Value binding position. |
|
string or null |
No |
The name of the node to which this field belongs. |
|
string or null |
No |
The positioning name of the node to which this field belongs. |
|
object or null |
No |
Layout configuration for the input form at runtime. |
|
string or null |
No |
The current resource version. |
|
array of object or null |
No |
Field grouping. |
|
string or null |
No |
Layout group ID. |
|
string or null |
No |
Title text. |
|
string or null |
No |
Display information. |
|
string or null |
No |
Node ID. |
|
array of string or null |
No |
Field ID within the group. |
|
object or null |
No |
Guidelines for using forms. |
|
string or null |
No |
Boot instructions. |
|
array of object or null |
No |
Path list. |
|
string or null |
No |
ID of the current object. |
|
string or null |
No |
Show labels. |
|
string or null |
No |
Description of the current object. |
|
array of string or null |
No |
Field ID within the group. |
|
array of object or null |
No |
Field grouping. |
|
string or null |
No |
ID of the current object. |
|
string or null |
No |
Show labels. |
|
array of string or null |
No |
List of path IDs. |
|
array of string or null |
No |
Field ID within the group. |
|
array of object or null |
No |
Field definition. |
|
string or null |
No |
Form field ID used to run input and layout associations. |
|
string or null |
No |
Associated roles. |
|
string or null |
No |
Additional explanation. |
|
string or null |
No |
Layout group ID. |
|
array of object or null |
No |
Is it fixed? |
|
string or null |
No |
Show labels. |
|
string or null |
No |
Value. |
|
object or null |
No |
Default value for input form at run time. Objects allow extended keys. |
|
object or null |
No |
Workflow design diagram configuration. Objects allow extended keys. |
|
object or null |
No |
Volume trigger configuration. When the volume ID is not provided in the runtime input form, |
|
integer or null |
No |
Volume ID. Required when a volume ID is not provided on the runtime input form. |
|
boolean or null |
No |
Whether to enable volume triggering. |
|
boolean or null |
No |
Whether to automatically distribute volume triggered runs. |
|
string or null |
No |
Variable JSON text used when the volume fires. |
|
integer or null |
No |
The maximum number of concurrent runs the volume can trigger. |
|
object or null |
No |
Dynamic service configuration. |
|
string or null |
No |
Dynamic service name. |
|
string or null |
Conditional |
JSON Schema text required when dynamic_service is explicitly supplied. Only the format validation supported by the current service is performed. |
|
string or null |
Conditional |
JSON Schema text required when dynamic_service is explicitly supplied. Only the format validation supported by the current service is performed. |
|
string or null |
No |
Result schema for dynamic services. |
|
string or null |
No |
JSON text for dynamic service runtime configuration. |
|
object or null |
No |
Final state notification configuration. |
|
string |
Yes |
type. |
|
string |
Yes |
Notification address. |
|
string or null |
No |
HTTP method. |
|
object or null |
No |
Notification request header. Objects allow extended keys. |
|
integer or null |
No |
Timeout seconds. |
|
JSON value |
No |
Worker ID. The value is empty string, |
|
JSON value |
No |
notification message. The value is empty string, |
|
array of string or null |
No |
Node notification status. |
|
array of string or null |
No |
Notify node ID. |
|
array |
Yes |
workflow notification status. |
|
string or null |
No |
workflow ID. |
|
string or null |
No |
This page describes |
|
object or null |
No |
MOWL workflow definition. |
|
string or null |
No |
The name of the current object. |
|
string or null |
No |
Root network name. |
|
string or null |
No |
User ID. |
|
object or null |
No |
Network definition, the key is the network name. Objects allow extended keys. |
|
boolean or null |
No |
Whether it is a temporary object. |
|
object or null |
No |
Node list. Objects allow extended keys. |
|
string or null |
No |
ID of the current object. |
|
string or null |
No |
The current resource version. |
|
object or null |
No |
Enter the connection configuration. |
|
string or null |
No |
type. |
|
array of string or null |
No |
Node list. |
|
array of string or null |
No |
Query statement list. |
|
object or null |
No |
Output connection configuration. |
|
string or null |
No |
type. |
|
array of string or null |
No |
Node list. |
|
array of string or null |
No |
Query statement list. |
|
object or null |
No |
Variable mapping. Objects allow extended keys. |
|
object or null |
No |
Defines source information, which is processed by the service when saving. |
|
string or null |
No |
Association ID. |
|
string or null |
No |
Association ID. |
|
string or null |
No |
Association ID. |
|
string or null |
No |
Catalog revision number. |
|
string or null |
No |
Directory snapshot summary. |
|
string or null |
No |
Source definition summary. |
|
string or null |
No |
Product summary. |
|
string or null |
No |
Envelope summary. |
|
string or null |
No |
syntax version. |
|
string or null |
No |
Compiler version. |
|
string or null |
No |
Source code. |
|
object or null |
No |
Required when |
|
string or null |
No |
Generate candidate A2A task IDs. |
|
string or null |
No |
Candidate product IDs returned by the same task. |
|
string |
Conditional |
Required when writing DSL by hand. Natural language candidates are not passed during deployment. |
|
string |
Yes |
Fill in |
|
object |
Yes |
Dynamic service configuration. |
|
string |
No |
Dynamic service name. |
|
string |
Conditional |
JSON Schema text required when dynamic_service is explicitly supplied. Only the format validation supported by the current service is performed. |
|
string |
Conditional |
JSON Schema text required when dynamic_service is explicitly supplied. Only the format validation supported by the current service is performed. |
|
string |
No |
Result schema for dynamic services. |
|
string |
No |
JSON text for dynamic service runtime configuration. |
|
string |
Yes |
Cron expressions. |
|
object |
No |
Volume trigger configuration. When the volume ID is not provided in the runtime input form, |
|
integer |
Conditional |
Volume ID. Required when a volume ID is not provided on the runtime input form. |
|
boolean |
No |
Whether to enable volume triggering. |
|
boolean |
No |
Whether to automatically distribute volume triggered runs. |
|
string |
No |
Variable JSON text used when the volume fires. |
|
integer |
No |
The maximum number of concurrent runs the volume can trigger. |
Other optional fields can be found on the “Single Run” tab.
Other optional fields can be found on the “Single Run” tab.
Other optional fields can be found on the “Single Run” tab.
This example requires that valid workflow candidates have been obtained and accepted. Save data.candidate_ref.task_id and data.candidate_ref.artifact_id in the received response as $TASK_ID and $ARTIFACT_ID respectively.
The server reads the definition of the candidate. This method does not accept caller submissions dsl_yaml, runtime_fields, runtime_layout, or design_graph. When a node or form needs to be adjusted, candidates should be regenerated and accepted. default_values provides the default value of the candidate run form, and the field name and type must be consistent with the candidate form. one_shot When deploying a candidate, the required run field must already have a value. Deployment fails when missing and cannot be replenished until the job is started.
The candidate deployment example assumes that the candidate contains the required string text. Replace with actual runtime_fields.fields. Invocation input for dynamic services is provided on each call and does not participate in this deployment integrity check.
Candidates must belong to the current workspace and calling user, have the source task completed, and have matching server acceptance records. When deploying without accepting a candidate, HTTP 409 is returned with error code ErrConflict. Candidate references cannot be replaced by arbitrary YAML, candidate objects, or self-constructed IDs.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"workflow": {
"id": "wf-001",
"name": "daily-import",
"source_type": "manual_dsl",
"execution_mode": "one_shot",
"draft_id": "draft-001",
"status": "ready"
},
"deployment": {
"workflow_app_id": "wf-001",
"workflow_def_id": "def-001",
"workflow_version_id": "ver-001",
"workflow_name": "daily-import",
"version": 1,
"execution_mode": "one_shot"
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
object |
MOWL workflow definition. |
|
string |
ID of the current object. |
|
string |
The name of the current object. |
|
string |
Source type. The values are |
|
string |
Execution mode: |
|
string |
Cron expressions. |
|
string |
Association ID. |
|
string |
Association ID. |
|
string |
status. The values are |
|
object |
Deployment results. |
|
string |
workflow application ID. |
|
string |
Workflow definition ID. |
|
string |
workflow version ID. |
|
string |
workflow name. |
|
integer |
workflow version number. |
|
string |
Published operating mode. The values are |
|
string |
Previous workflow version ID. Returned when updating existing workflow version. |
|
array of string |
ID of the disabled scheduled task. Returned when replacing a scheduled task. |
|
object |
Volume trigger configuration. Returned for volume-triggered execution. |
|
integer |
ID of the current object. |
|
integer |
Association ID. |
|
string |
Association ID. |
|
boolean |
Whether to enable. |
|
string |
Creator ID. |
|
string |
Identifier of the last updated person. |
|
integer |
Creation time. |
|
integer |
Last updated time. |
|
string |
Run variables. |
|
integer |
Maximum number of concurrencies. |
|
boolean |
Whether to distribute automatically. |
|
string |
Association ID. |
|
object |
Scheduled task information. Returned for scheduled triggers. |
|
string |
ID of the current object. |
|
string |
The workspace ID to which it belongs. |
|
string |
The name of the current object. |
|
string |
Cron expressions. |
|
string |
Data content. |
|
string |
Run variables. |
|
integer |
status. |
|
string |
Creation time. |
|
string |
Last updated time. |
|
string |
Association ID. |
|
string |
Association ID. |
|
object |
Dynamic service information. Returned for dynamic services. |
|
string |
Display information. |
|
object |
Call configuration. |
|
string |
HTTP method. |
|
string |
Field path. |
|
string |
Result return method. |
|
object |
The request body example object allows extended keys. |
|
object |
The current resource version. |
|
string |
ID of the current object. |
|
string |
The workspace ID to which it belongs. |
|
string |
workflow ID. |
|
integer |
The current resource version. |
|
JSON value |
MOWL workflow definition. |
|
string |
status. The values are |
|
string |
Creator ID. |
|
string |
Creation time. |
|
string |
time information. |
|
integer |
type. The values are |
|
string |
Enter the defined JSON text. |
|
string |
Outputs the JSON text of the definition. |
|
integer |
Result return method. The values are |
|
string |
Description of the current object. |
|
string |
JSON text of the run specification. |
|
array of string |
Prompt information. |
Error response¶
During deployment, records will be saved in stages and associated operators will be created. Records that have not yet been completed may be in a pending status and not appear in the list. After a deployment fails, some records may remain. Please save the request and tracking ID for subsequent troubleshooting.
Save the request and tracking IDs in the response. Repeated submissions of a candidate or request ID will still check the content digest and calling identity. Do not change the logo and automatically retry after an error.
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |