HTTP API
Once you run flawless up
, it will start a local HTTP server listening by default on port
8000
. You can use this server to start new workflows or query running and finished ones.
POST /workflow/start/<module>/<workflow>
Starts a new workflow. The <module>
is the name under which the .wasm
module was
registered and <workflow>
is the name of the workflow itself. The POST request can
contain a JSON structure in the body, this will be used as the input argument to the
workflow.
If successful, the endpoint returns the workflow ID.
$ curl -X POST localhost:8000/workflow/start/test/hello -d '"Flawless"'
{"id": 16}
The body of the request is double-quoted, because it needs to be a valid JSON value.
GET /workflow/<id>
Returns information about the workflow, including the execution status and any data if set during the workflow execution.
$ curl -X GET localhost:8000/workflow/16
{
status: "Success",
data: {
message: "Hello Flawless"
}
}
The data
is an arbitrary value and can be set from inside the workflow using
set_data
. The status
can have the following values:
- "Initializing"
- "Executing"
- "Paused"
- "Success"
- "Failure"