Create workflow

Create a workflow definition in the current workspace. The job will not be started automatically after successful creation.

HTTP
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.

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

name

string

Yes

workflow name.

description

string or null

No

workflow description.

execution_mode

string or null

No

Fill in volume_trigger.

cron_expression

string or null

No

Cron expressions.

dsl_yaml

string or null

No

Required when writing DSL by hand. Natural language candidates are not passed during deployment.

compute_resource_id

string or null

No

The associated computing resource ID.

runtime_fields

object or null

No

Run-time input form configuration.

runtime_fields.title

string or null

No

Title text.

runtime_fields.description

string or null

No

Description of the current object.

runtime_fields.fields

array of object or null

No

Field definition.

runtime_fields.fields[].field_id

string or null

No

Form field ID used to run input and layout associations.

runtime_fields.fields[].label

string or null

No

Show labels.

runtime_fields.fields[].description

string or null

No

Description of the current object.

runtime_fields.fields[].widget

string or null

No

Input control type.

runtime_fields.fields[].json_type

string or null

No

JSON type.

runtime_fields.fields[].model_type

string or null

No

Model type label.

runtime_fields.fields[].required

boolean or null

No

Is it required?

runtime_fields.fields[].default

JSON value or null

No

Default value.

runtime_fields.fields[].has_default

boolean or null

No

Is there a default value?

runtime_fields.fields[].placeholder

string or null

No

Enter the prompt.

runtime_fields.fields[].pattern

string or null

No

String matching pattern.

runtime_fields.fields[].runtime_config_path

string or null

No

Field path in run configuration.

runtime_fields.fields[].section

string or null

No

The block it belongs to.

runtime_fields.fields[].group

string or null

No

The group it belongs to.

runtime_fields.fields[].on_value

string or null

No

Value when enabled.

runtime_fields.fields[].off_value

string or null

No

value when closed.

runtime_fields.fields[].hidden

boolean or null

No

Whether to hide.

runtime_fields.fields[].read_only

boolean or null

No

Whether it is read-only.

runtime_fields.fields[].sensitive

boolean or null

No

Whether it contains sensitive values.

runtime_fields.fields[].options

array of object or null

No

Optional.

runtime_fields.fields[].options[].label

string or null

No

Show labels.

runtime_fields.fields[].options[].value

JSON value or null

No

Value.

runtime_fields.fields[].options[].description

string or null

No

Description of the current object.

runtime_fields.fields[].min

number or null

No

minimum value.

runtime_fields.fields[].max

number or null

No

maximum value.

runtime_fields.fields[].accept

array of string or null

No

Allowed file types.

runtime_fields.fields[].resource_type

string or null

No

Resource type.

runtime_fields.fields[].visible_when

object or null

No

Show conditions.

runtime_fields.fields[].visible_when.field_id

string or null

No

Form field ID used to run input and layout associations.

runtime_fields.fields[].visible_when.value

JSON value or null

No

Value.

runtime_fields.fields[].bind_to

string or object or null

No

Value binding position.

runtime_fields.fields[].owner_node_name

string or null

No

The name of the node to which this field belongs.

runtime_fields.fields[].owner_node_id

string or null

No

The positioning name of the node to which this field belongs.

runtime_layout

object or null

No

Layout configuration for the input form at runtime.

runtime_layout.version

string or null

No

The current resource version.

runtime_layout.groups

array of object or null

No

Field grouping.

runtime_layout.groups[].group_id

string or null

No

Layout group ID.

runtime_layout.groups[].title

string or null

No

Title text.

runtime_layout.groups[].node_name

string or null

No

Display information.

runtime_layout.groups[].node_id

string or null

No

Node ID.

runtime_layout.groups[].field_ids

array of string or null

No

Field ID within the group.

runtime_layout.guide

object or null

No

Guidelines for using forms.

runtime_layout.guide.lead

string or null

No

Boot instructions.

runtime_layout.guide.paths

array of object or null

No

Path list.

runtime_layout.guide.paths[].id

string or null

No

ID of the current object.

runtime_layout.guide.paths[].label

string or null

No

Show labels.

runtime_layout.guide.paths[].description

string or null

No

Description of the current object.

runtime_layout.guide.paths[].field_ids

array of string or null

No

Field ID within the group.

runtime_layout.guide.groups

array of object or null

No

Field grouping.

runtime_layout.guide.groups[].id

string or null

No

ID of the current object.

runtime_layout.guide.groups[].label

string or null

No

Show labels.

runtime_layout.guide.groups[].path_ids

array of string or null

No

List of path IDs.

runtime_layout.guide.groups[].field_ids

array of string or null

No

Field ID within the group.

runtime_layout.guide.fields

array of object or null

No

Field definition.

runtime_layout.guide.fields[].field_id

string or null

No

Form field ID used to run input and layout associations.

runtime_layout.guide.fields[].role

string or null

No

Associated roles.

runtime_layout.guide.fields[].note

string or null

No

Additional explanation.

runtime_layout.guide.fields[].group_id

string or null

No

Layout group ID.

runtime_layout.guide.fixed

array of object or null

No

Is it fixed?

runtime_layout.guide.fixed[].label

string or null

No

Show labels.

runtime_layout.guide.fixed[].value

string or null

No

Value.

default_values

object or null

No

Default value for input form at run time. Objects allow extended keys.

design_graph

object or null

No

Workflow design diagram configuration. Objects allow extended keys.

volume_trigger

object or null

No

Volume trigger configuration. When the volume ID is not provided in the runtime input form, volume_id must be filled in.

volume_trigger.volume_id

integer or null

No

Volume ID. Required when a volume ID is not provided on the runtime input form.

volume_trigger.enabled

boolean or null

No

Whether to enable volume triggering.

volume_trigger.auto_dispatch_enabled

boolean or null

No

Whether to automatically distribute volume triggered runs.

volume_trigger.vars_json

string or null

No

Variable JSON text used when the volume fires.

volume_trigger.max_concurrency

integer or null

No

The maximum number of concurrent runs the volume can trigger.

dynamic_service

object or null

No

Dynamic service configuration.

dynamic_service.service_name

string or null

No

Dynamic service name.

dynamic_service.input_schema

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.

dynamic_service.output_schema

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.

dynamic_service.result_mode

string or null

No

Result schema for dynamic services.

dynamic_service.runtime_spec_json

string or null

No

JSON text for dynamic service runtime configuration.

notification_config

object or null

No

Final state notification configuration.

notification_config.type

string

Yes

type.

notification_config.url

string

Yes

Notification address.

notification_config.method

string or null

No

HTTP method.

notification_config.headers

object or null

No

Notification request header. Objects allow extended keys.

notification_config.timeout

integer or null

No

Timeout seconds.

notification_config.worker_id

JSON value

No

Worker ID. The value is empty string, null.

notification_config.message

JSON value

No

notification message. The value is empty string, null.

notification_config.notify_node_states

array of string or null

No

Node notification status.

notification_config.notify_node_ids

array of string or null

No

Notify node ID.

notification_config.notify_workflow_states

array

Yes

workflow notification status.

workflow_id

string or null

No

workflow ID.

source_type

string or null

No

This page describes manual_dsl (default) and nl2dsl. DSL filling using memory management WorkItem.

workflow

object or null

No

MOWL workflow definition.

workflow.name

string or null

No

The name of the current object.

workflow.root

string or null

No

Root network name.

workflow.user_id

string or null

No

User ID.

workflow.nets

object or null

No

Network definition, the key is the network name. Objects allow extended keys.

workflow.nets["键"].transient

boolean or null

No

Whether it is a temporary object.

workflow.nets["键"].nodes

object or null

No

Node list. Objects allow extended keys.

workflow.nets["键"].nodes["键"].id

string or null

No

ID of the current object.

workflow.nets["键"].nodes["键"].version

string or null

No

The current resource version.

workflow.nets["键"].nodes["键"].in_connector

object or null

No

Enter the connection configuration.

workflow.nets["键"].nodes["键"].in_connector.type

string or null

No

type.

workflow.nets["键"].nodes["键"].in_connector.nodes

array of string or null

No

Node list.

workflow.nets["键"].nodes["键"].in_connector.queries

array of string or null

No

Query statement list.

workflow.nets["键"].nodes["键"].out_connector

object or null

No

Output connection configuration.

workflow.nets["键"].nodes["键"].out_connector.type

string or null

No

type.

workflow.nets["键"].nodes["键"].out_connector.nodes

array of string or null

No

Node list.

workflow.nets["键"].nodes["键"].out_connector.queries

array of string or null

No

Query statement list.

workflow.nets["键"].nodes["键"].var_map

object or null

No

Variable mapping. Objects allow extended keys.

workflow.provenance

object or null

No

Defines source information, which is processed by the service when saving.

workflow.provenance.task_id

string or null

No

Association ID.

workflow.provenance.artifact_id

string or null

No

Association ID.

workflow.provenance.candidate_id

string or null

No

Association ID.

workflow.provenance.catalog_revision

string or null

No

Catalog revision number.

workflow.provenance.catalog_snapshot_digest

string or null

No

Directory snapshot summary.

workflow.provenance.source_digest

string or null

No

Source definition summary.

workflow.provenance.artifact_digest

string or null

No

Product summary.

workflow.provenance.envelope_digest

string or null

No

Envelope summary.

workflow.provenance.syntax_version

string or null

No

syntax version.

workflow.provenance.compiler_version

string or null

No

Compiler version.

workflow.provenance.source_code

string or null

No

Source code.

candidate_ref

object or null

No

Required when nl2dsl refers to an accepted build candidate.

candidate_ref.task_id

string or null

No

Generate candidate A2A task IDs.

candidate_ref.artifact_id

string or null

No

Candidate product IDs returned by the same task.

dsl_yaml

string

Conditional

Required when writing DSL by hand. Natural language candidates are not passed during deployment.

execution_mode

string

Yes

Fill in dynamic_service. Fill in cron. Fill in volume_trigger.

dynamic_service

object

Yes

Dynamic service configuration.

dynamic_service.service_name

string

No

Dynamic service name.

dynamic_service.input_schema

string

Conditional

JSON Schema text required when dynamic_service is explicitly supplied. Only the format validation supported by the current service is performed.

dynamic_service.output_schema

string

Conditional

JSON Schema text required when dynamic_service is explicitly supplied. Only the format validation supported by the current service is performed.

dynamic_service.result_mode

string

No

Result schema for dynamic services.

dynamic_service.runtime_spec_json

string

No

JSON text for dynamic service runtime configuration.

cron_expression

string

Yes

Cron expressions.

volume_trigger

object

No

Volume trigger configuration. When the volume ID is not provided in the runtime input form, volume_id must be filled in.

volume_trigger.volume_id

integer

Conditional

Volume ID. Required when a volume ID is not provided on the runtime input form.

volume_trigger.enabled

boolean

No

Whether to enable volume triggering.

volume_trigger.auto_dispatch_enabled

boolean

No

Whether to automatically distribute volume triggered runs.

volume_trigger.vars_json

string

No

Variable JSON text used when the volume fires.

volume_trigger.max_concurrency

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

JSON
{
  "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

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.workflow

object

MOWL workflow definition.

data.workflow.id

string

ID of the current object.

data.workflow.name

string

The name of the current object.

data.workflow.source_type

string

Source type. The values are nl2dsl, manual_dsl, manual_mowl, system, agent_automation_task

data.workflow.execution_mode

string

Execution mode: one_shot, volume_trigger, cron, dynamic_service, task_by_version.

data.workflow.cron_expression

string

Cron expressions.

data.workflow.draft_id

string

Association ID.

data.workflow.candidate_id

string

Association ID.

data.workflow.status

string

status. The values are ready, disabled, paused

data.deployment

object

Deployment results.

data.deployment.workflow_app_id

string

workflow application ID.

data.deployment.workflow_def_id

string

Workflow definition ID.

data.deployment.workflow_version_id

string

workflow version ID.

data.deployment.workflow_name

string

workflow name.

data.deployment.version

integer

workflow version number.

data.deployment.execution_mode

string

Published operating mode. The values ​​are one_shot, volume_trigger, cron, dynamic_service, task_by_version

data.deployment.previous_workflow_version_id

string

Previous workflow version ID. Returned when updating existing workflow version.

data.deployment.disabled_cron_task_ids

array of string

ID of the disabled scheduled task. Returned when replacing a scheduled task.

data.deployment.volume_trigger

object

Volume trigger configuration. Returned for volume-triggered execution.

data.deployment.volume_trigger.id

integer

ID of the current object.

data.deployment.volume_trigger.volume_id

integer

Association ID.

data.deployment.volume_trigger.workflow_version_id

string

Association ID.

data.deployment.volume_trigger.enabled

boolean

Whether to enable.

data.deployment.volume_trigger.created_by

string

Creator ID.

data.deployment.volume_trigger.updated_by

string

Identifier of the last updated person.

data.deployment.volume_trigger.created_at

integer

Creation time.

data.deployment.volume_trigger.updated_at

integer

Last updated time.

data.deployment.volume_trigger.vars

string

Run variables.

data.deployment.volume_trigger.max_concurrency

integer

Maximum number of concurrencies.

data.deployment.volume_trigger.auto_dispatch_enabled

boolean

Whether to distribute automatically.

data.deployment.volume_trigger.workflow_app_id

string

Association ID.

data.deployment.cron_task

object

Scheduled task information. Returned for scheduled triggers.

data.deployment.cron_task.id

string

ID of the current object.

data.deployment.cron_task.workspace_id

string

The workspace ID to which it belongs.

data.deployment.cron_task.name

string

The name of the current object.

data.deployment.cron_task.cron_expression

string

Cron expressions.

data.deployment.cron_task.data

string

Data content.

data.deployment.cron_task.vars

string

Run variables.

data.deployment.cron_task.status

integer

status.

data.deployment.cron_task.created_at

string

Creation time.

data.deployment.cron_task.updated_at

string

Last updated time.

data.deployment.cron_task.workflow_version_id

string

Association ID.

data.deployment.cron_task.compute_resource_id

string

Association ID.

data.deployment.dynamic_service

object

Dynamic service information. Returned for dynamic services.

data.deployment.dynamic_service.service_name

string

Display information.

data.deployment.dynamic_service.invoke

object

Call configuration.

data.deployment.dynamic_service.invoke.method

string

HTTP method.

data.deployment.dynamic_service.invoke.path

string

Field path.

data.deployment.dynamic_service.invoke.result_mode

string

Result return method.

data.deployment.dynamic_service.invoke.body_example

object

The request body example object allows extended keys.

data.deployment.dynamic_service.version

object

The current resource version.

data.deployment.dynamic_service.version.id

string

ID of the current object.

data.deployment.dynamic_service.version.workspace_id

string

The workspace ID to which it belongs.

data.deployment.dynamic_service.version.workflow_id

string

workflow ID.

data.deployment.dynamic_service.version.version

integer

The current resource version.

data.deployment.dynamic_service.version.workflow

JSON value

MOWL workflow definition.

data.deployment.dynamic_service.version.status

string

status. The values are draft, published, deprecated

data.deployment.dynamic_service.version.created_by

string

Creator ID.

data.deployment.dynamic_service.version.created_at

string

Creation time.

data.deployment.dynamic_service.version.published_at

string

time information.

data.deployment.dynamic_service.version.type

integer

type. The values are 1, 2

data.deployment.dynamic_service.version.input_schema

string

Enter the defined JSON text.

data.deployment.dynamic_service.version.output_schema

string

Outputs the JSON text of the definition.

data.deployment.dynamic_service.version.result_mode

integer

Result return method. The values are 0, 1, 2

data.deployment.dynamic_service.version.description

string

Description of the current object.

data.deployment.dynamic_service.version.runtime_spec_json

string

JSON text of the run specification.

data.warnings

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.

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效"
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrParamInvalid, ErrWorkspaceRequired

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden

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

ErrNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

ErrConflict

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on