kymr / conductor

Conductor is a microservices orchestration engine - https://netflix.github.io/conductor/
Apache License 2.0
0 stars 0 forks source link

Summary - APIs #11

Closed kymr closed 6 years ago

kymr commented 6 years ago

Link

kymr commented 6 years ago

Task & Workflow Metadata

Endpoint Description Input
GET /metadata/taskdefs Get all the task definitions n/a
GET /metadata/taskdefs/{taskType} Retrieve task definition Task Name
POST /metadata/taskdefs Register new task definitions List of Task Definitions
PUT /metadata/taskdefs Update a task definition A Task Definition
DELETE /metadata/taskdefs/{taskType} Delete a task definition Task Name
     
GET /metadata/workflow Get all the workflow definitions n/a
POST /metadata/workflow Register new workflow Workflow Definition
PUT /metadata/workflow Register/Update new workflows List of Workflow Definition
GET /metadata/workflow/{name}?version= Get the workflow definitions workflow name, version (optional)
kymr commented 6 years ago

Start A Workflow

With Input only

POST /workflow/{name}?version=&correlationId=
{
   //JSON payload for workflow
}
Parameter Description
version Optional. If not specified uses the latest version of the workflow
correlationId User supplied Id that can be used to retrieve workflows

Input

Output

With Input and Task Domains

POST /workflow
{
   //JSON payload for Start workflow request
}

Start workflow request

kymr commented 6 years ago

Retrieve Workflows

Endpoint Description
GET /workflow/{workflowId}?includeTasks=true|false Get Workflow State by workflow Id. If includeTasks is set, then also includes all the tasks executed and scheduled.
GET /workflow/running/{name} Get all the running workflows of a given type
GET /workflow/running/{name}/correlated/{correlationId}?includeClosed=true|false&includeTasks=true|false Get all the running workflows filtered by correlation Id. If includeClosed is set, also includes workflows that have completed running.
GET /workflow/search Search for workflows. See Below.
kymr commented 6 years ago

Search for Workflows

Parameter Description
start Page number. Defaults to 0
size Number of results to return
sort Sorting. Format is: ASC: or DESC: to sort in ascending or descending order by a field
freeText Elasticsearch supported query. e.g. workflowType:"name_of_workflow"
query SQL like where clause. e.g. workflowType = 'name_of_workflow'. Optional if freeText is provided.

Output

kymr commented 6 years ago

Manage Workflows

Endpoint Description
PUT /workflow/{workflowId}/pause Pause. No further tasks will be scheduled until resumed. Currently running tasks are not paused.
PUT /workflow/{workflowId}/resume Resume normal operations after a pause.
POST /workflow/{workflowId}/rerun See Below.
POST /workflow/{workflowId}/restart Restart workflow execution from the start. Current execution history is wiped out.
POST /workflow/{workflowId}/retry Retry the last failed task.
PUT /workflow/{workflowId}/skiptask/{taskReferenceName} See below.
DELETE /workflow/{workflowId} Terminates the running workflow.
DELETE /workflow/{workflowId}/remove Deletes the workflow from system. Use with caution.

Rerun

Skip Task

kymr commented 6 years ago

Manage Tasks

Endpoint Description
GET /tasks/{taskId} Get task details.
GET /tasks/queue/all List the pending task sizes.
GET /tasks/queue/all/verbose Same as above, includes the size per shard
GET /tasks/queue/sizes?taskType=&taskType=&taskType Return the size of pending tasks for given task types
kymr commented 6 years ago

Polling, Ack and Update Task

Endpoint Description
GET /tasks/poll/{taskType}?workerid=&domain= Poll for a task. workerid identifies the worker that polled for the job and domain allows the poller to poll for a task in a specific domain
GET /tasks/poll/batch/{taskType}?count=&timeout=&workerid=&domain Poll for a task in a batch specified by count. This is a long poll and the connection will wait until timeout or if there is at-least 1 item available, whichever comes first.workerididentifies the worker that polled for the job and domainallows the poller to poll for a task in a specific domain
POST /tasks Update the result of task execution. See the schema below.
POST /tasks/{taskId}/ack Acknowledges the task received AFTER poll by worker.

Schema for updating Task Result

{
    "workflowInstanceId": "Workflow Instance Id",
    "taskId": "ID of the task to be updated",
    "reasonForIncompletion" : "If failed, reason for failure",
    "callbackAfterSeconds": 0,
    "status": "IN_PROGRESS|FAILED|COMPLETED",
    "outputData": {
        //JSON document representing Task execution output     
    }

}

Acknowledging tasks after poll

kymr commented 6 years ago

Check it

Common

Retrieve and Search Workflows

Manage Workflows

Manage Tasks

Polling, Ack and Update Task