Trigger Flow

Manually trigger a workflow schedule.

Prerequisites

  • The user must be the owner of the workflow.

  • Both the user and the workflow are not locked.

Request Format

POST https://{apigw-address}/dataflow-batch-service/v2.0/flows

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

userId

Query

Mandatory

String

The user ID. How to get userId>>

orgId

Query

Mandatory

String

The organization ID which the user belongs to. How to get orgId>>

action

Query

Mandatory

String

Fixed value: trigger

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

flowId

Mandatory

Integer

The workflow ID.

triggerTime

Mandatory

Long

Specify the trigger time of the workflow, keeping in mind the following rules:

  • If the triggering time is before the current time, the workflow will be triggered immediately, and the triggering time will be passed into the time parameters for calculation.

  • The workflow only allows one instance to run at any one time. If the pre-run instance conflicts with a running instance, it will be executed in sequence.

Response Parameters

Name

Data Type

Description

data

FlowInstanceId Struct

The details of a workflow instance. For more information, see FlowInstanceId Struct

FlowInstanceId Struct

Sample

{
  "flowInstanceId": "2430-20190718075000"
}

Parameters

Name

Data Type

Description

flowInstanceId

String

The ID of the workflow instance.

Error Code

Code

Message

Description

62104

This workflow has no task. You cannot trigger it.

The workflow does not have any task for you to trigger.

62109

Server internal exception

Internal server exception.

For other error codes, see Common Error Codes.

Samples

Request Sample

url: https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=trigger&userId=yourUserId&orgId=yourOrgId
method: POST
{
  "flowId":3377,
  "triggerTime":1574385824000
}

Return Sample

{
  "status": 0,
  "msg": " Success",
  "data": {
    "flowInstanceId": "2791-19700101000000"
  }
}

SDK Samples


You can access the SDK samples for batch data processing service on GitHub: