treasure-data / digdag

Workload Automation System
https://www.digdag.io/
Apache License 2.0
1.3k stars 221 forks source link

Trigger a workflow execution by requesting the REST API endpoint #1736

Closed mattp0123 closed 1 year ago

mattp0123 commented 2 years ago

I want to trigger my workflow by requesting the REST API endpoint of my Digdag server. So I follow this docs: https://docs.digdag.io/api/ To trigger a workflow, I have to request the PUT /api/attempts endpoint with body like this:

{
  workflowId: <my_workflow_id>,
  sessionTime: <session_time>,
  params: {}
}

Could it be like the Digdag client mode command:

digdag start my-project my-workflow --session now

Something like this?

{
  workflow: { name: 'my_workflow', project: 'my_project' },
  sessionTime: 'now',
  params: {}
}

I think the REST API docs could be more detailed BTW.

yoyama commented 2 years ago

You can get <my_workflow_id> with following APIs

  1. Get project ID "GET /api/projects?name=my_project"
  2. Get workflow ID "GET /api/projects//workflows/my_workflow