-
Notifications
You must be signed in to change notification settings - Fork 10
Workflow Endpoints
The endpoint for creating a workflow is /workflows/create
and the data it requires is the following:
{
'name': <str>,
'description': <str>,
'inputs':
[
{
"id": <str>,
"name": <str>,
"type": <data-type>,
}, ...
],
'outputs':
[
{
"id": <str>,
"name": <str>,
"type": <output-type>,
"<output-type>" : <OUTPUT-TYPE SECTION>
}, ...
]
}
Here <data-type>
is a choice between image
or text
; and <output-type>
is a choice between binary
, single-class
, multi-selection
or freetext
.
Below are the different output sections formats:
{
“options”: {
true: "Yes",
false: "No"
},
}
{
“options”: [
{ "id": "option-1-id", "name": "Option 1"},
{ "id": "option-2-id", "name": "Option 2"},
{ "id": "option-3-id", "name": "Option 3"}],
}
{
“options”: [
{ "id": "option-1-id", "name": "Option 1"},
{ "id": "option-2-id", "name": "Option 2"},
{ "id": "option-3-id", "name": "Option 3"}],
}
{}
To get a list of the workflows in your organization you can do a GET
call to /workflows/
.
To retrieve a specific workflow you can do so by calling GET
to /workflows/<workflow-id>
. To update the workflow you call the same endpoint but use PATCH
instead along with a payload including the attributes you want to update. Below is an example of a payload for updating the description of a workflow:
{"description": "This is the new updated description of an existing workflow"}
Remember you will only have permission to retrieve and update the workflows which are part of your organization.
To upload CSV files you have to POST
a message including the file to /workflows/<workflow-id>/upload/
To get the list of tasks in a given workflow you should do call a GET
to the endpoint /workflows/<workflow-id>/tasks/
To retrieve a task you can either call a GET
to the endpoint /workflows/<workflow-id>/tasks/next
and this will give a incomplete task.
Another way is to retrieve a specific task and that is by doing a GET
to the endpoint /workflows/<workflow-id>/tasks/<task-id>
, if you do a PATCH
to this endpoint you will be able to update the task. You will only be able to update the output.