Stop Workflow

Once the program has been set up and a workflow created and running, workflow and workflow run can be stopped.

To stop workflow run by id:

curl -X 'POST' \
  'http://${API_SERVICE_URL}:${API_SERVICE_PORT}/api/v1/workflow-run/${WORKFLOW_RUN_ID}/stop' \
  -H 'accept: */*'

Where:

  • API_SERVICE_URL is the endpoint of the service. If running locally, this will likely be localhost

  • API_SERVICE_PORT is the port exposed for the service. The default port is 8081.

  • WORKFLOW_RUN_ID is the ID of the specific run of a workflow to stop.

If the service is up and running correctly, and the workflow ID is correct, you should receive a 200 status with the body containing information like:

{
  "message": "WorkflowRun 3 stopped successfully",
  "stop_workflow_run_response": {
    "workflow_run_id": 3,
    "workflow_run_status": "STOPPED",
    "start_date": "2022-05-16T11:19:43.289371Z",
    "end_date": "2022-05-16T11:20:11.793064Z",
    "user_id": 0,
    "error_message": null,
    "steps": [
      {
        "workflow_run_step_id": 6,
        "workflow_run_id": 3,
        "name": "VALIDATION",
        "workflow_run_step_status": "STOPPED",
        "total_time_millis": 28494
      }
    ]
  }
}

To stop workflow run by workflow id:

curl -X 'POST' \
  'http://${API_SERVICE_URL}:${API_SERVICE_PORT}/api/v1/workflow/${WORKFLOW_ID}/stop' \
  -H 'accept: */*'

Where:

  • API_SERVICE_URL is the endpoint of the service. If running locally, this will likely be localhost

  • API_SERVICE_PORT is the port exposed for the service. The default port is 8081.

  • WORKFLOW_ID is the WORKFLOW_ID of the specific workflow run to stop.

If the service is up and running correctly, and the workflow ID is correct, you should receive a 200 status with the body containing information like:

{
  "message": "WorkflowRun with WorkflowId = 0 stopped successfully",
  "stop_workflow_run_response": {
    "workflow_run_id": 3,
    "workflow_run_status": "STOPPED",
    "start_date": "2022-05-16T11:19:43.289371Z",
    "end_date": "2022-05-16T11:20:11.793064Z",
    "user_id": 0,
    "error_message": null,
    "steps": [
      {
        "workflow_run_step_id": 6,
        "workflow_run_id": 3,
        "name": "VALIDATION",
        "workflow_run_step_status": "STOPPED",
        "total_time_millis": 28494
      }
    ]
  }
}