Workflow User API
Creates an instance of a defined workflow and makes it ready to be executed immediately or at a specified time.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Identifier of workflow (If not provided, will be auto-generated). | |
label | string | Human- or machine-readable description of workflow instance.
Example: Import Patient resources | |
definition | string | Definition of predefined workflow or
custom-defined workflow.
Example: aidbox.bulk/import-resources-workflow | |
params | object | The input parameters described in the workflow definition. | |
executeAt | string | Time at which the workflow will become ready. If not provided - workflow will become ready immediately.
Example: 2023-05-03T13:30:43 |
Parameter | Type | Description |
---|---|---|
resources | object[] | Created AidboxWorkflow resources. |
Request
Response
POST /rpc
content-type: text/yaml
accept: text/yaml
method: awf.workflow/create-and-execute
params:
definition: aidbox.bulk/import-resources-workflow
params:
type: aidbox
inputs:
- url: https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
result:
resource:
params:
type: aidbox
inputs:
- url: >-
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
status: in-progress
definition: aidbox.bulk/import-resources-workflow
id: >-
abbc317d-f9b0-415e-b5b5-df059e000060
resourceType: AidboxWorkflow
meta:
lastUpdated: '2023-05-22T11:55:06.570348Z'
createdAt: '2023-05-22T11:55:06.570348Z'
versionId: '18039'
Cancels a workflow that is not in status
done
, canceling recursively all activities started by that workflow.Parameter | Type | Required | Description |
---|---|---|---|
id | string | Id of the workflow to be canceled. |
Parameter | Type | Description |
---|---|---|
resource | object | The canceled AidboxWorkflow resource. |
Request
Response
Response (already done)
POST /rpc
content-type: text/yaml
accept: text/yaml
method: awf.workflow/cancel
params:
id: af10a9cf-3313-45f0-bbf4-7d3bf3a4da37
result:
resource:
params:
type: aidbox
inputs:
- url: https://synthea-public.s3.amazonaws.com/2/Claim.ndjson.gz
resourceType: Claim
contentEncoding: gzip
status: done
outcome: canceled
definition: aidbox.bulk/import-resources-workflow
id: >-
af10a9cf-3313-45f0-bbf4-7d3bf3a4da37
resourceType: AidboxWorkflow
meta:
lastUpdated: '2023-06-15T12:58:31.362126Z'
createdAt: '2023-06-15T12:58:22.604066Z'
versionId: '712'
status: 422
error:
type: workflow-has-been-done
message: >-
Workflow id:'af10a9cf-3313-45f0-bbf4-7d3bf3a4da37' has already been done.
Couldn't cancel it.
Returns the status of a workflow instance with the specified id.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Id of the workflow whose status will be returned. | |
include-activities? | boolean | If true , includes tasks and another workflows started by workflow.
Default: false | |
include-decisions? | boolean |
Parameter | Type | Description |
---|---|---|
resource | object | AidboxWorkflow resource. |
activities | object[] | Activities started by workflow. |
decisions | object[] | Decision task resources of workflow. |
Request
Response
POST /rpc
content-type: text/yaml
accept: text/yaml
method: awf.workflow/status
params:
id: abbc317d-f9b0-415e-b5b5-df059e000060
include-activities?: true
include-decisions?: true
result:
resource:
params:
type: aidbox
inputs:
- url: >-
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
result:
message: All input files imported, 0 new resources loaded
total-files: 1
total-imported-resources: 0
status: done
outcome: succeeded
definition: aidbox.bulk/import-resources-workflow
id: >-
abbc317d-f9b0-415e-b5b5-df059e000060
resourceType: AidboxWorkflow
meta:
lastUpdated: '2023-05-22T11:55:07.427230Z'
createdAt: '2023-05-22T11:55:06.570348Z'
versionId: '18073'
activities:
- definition: aidbox.bulk/import-resource-task
meta:
lastUpdated: '2023-05-22T11:55:07.379041Z'
createdAt: '2023-05-22T11:55:06.673539Z'
versionId: '18061'
params:
type: aidbox
input:
url: >-
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
retryCount: 1
outcome: succeeded
resourceType: AidboxTask
requester:
id: >-
abbc317d-f9b0-415e-b5b5-df059e000060
resourceType: AidboxWorkflow
status: done
result:
imported-resources: 0
execId: f5fd6d24-b240-4225-87c7-c57538bf083c
label: >-
Organization
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
id: >-
6e718350-0fc1-4bdd-b8e2-d73890f4fff7
decisions:
- definition: awf.workflow/decision-task
meta:
lastUpdated: '2023-05-22T11:55:06.673539Z'
createdAt: '2023-05-22T11:55:06.570348Z'
versionId: '18049'
params:
event: awf.workflow.event/workflow-init
retryCount: 1
outcome: succeeded
workflow-definition: aidbox.bulk/import-resources-workflow
resourceType: AidboxTask
requester:
id: >-
abbc317d-f9b0-415e-b5b5-df059e000060
resourceType: AidboxWorkflow
status: done
result:
- action: awf.workflow.action/schedule-task
task-request:
label: >-
Organization
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
params:
type: aidbox
input:
url: >-
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
definition: aidbox.bulk/import-resource-task
execId: 7d8d6ad5-fbd8-4bce-b7a0-daaf8cd91f13
id: >-
97c7b246-de63-4302-927d-6dc160d332af
- definition: awf.workflow/decision-task
meta:
lastUpdated: '2023-05-22T11:55:07.427230Z'
createdAt: '2023-05-22T11:55:07.379041Z'
versionId: '18071'
params:
event: awf.workflow.event/task-completed
task-id: 6e718350-0fc1-4bdd-b8e2-d73890f4fff7
retryCount: 1
outcome: succeeded
workflow-definition: aidbox.bulk/import-resources-workflow
resourceType: AidboxTask
requester:
id: >-
abbc317d-f9b0-415e-b5b5-df059e000060
resourceType: AidboxWorkflow
status: done
result:
- action: awf.workflow.action/complete-workflow
result:
message: All input files imported, 0 new resources loaded
total-files: 1
total-imported-resources: 0
execId: e7820ed2-92e7-4635-846d-35331051b466
id: >-
439dd4a4-7d70-4cf2-85ce-244878a2c910
Returns the list of all workflows.
Parameter | Type | Required | Description |
---|---|---|---|
filter | object | | |
filter.status | string | Include workflow with specified status.
Possible values: created , in-progress , done | |
filter.outcome | string | Include workflow with status done and specified outcome.
Possible values: succeeded , failed | |
filter.ilike | string | ilike search by resource content | |
sort | object | May contain either createdAt or lastUpdated . | |
sort.createdAt | string | Sorts result by createdAt DateTime.
Possible values: asc , desc | |
sort.lastUpdated | string | Sorts result by lastUpdated DateTime.
Possible values: asc , desc |
Parameter | Type | Description |
---|---|---|
resources | object[] | AidboxWorkflow resources. |
Request
Response
POST /rpc
content-type: text/yaml
accept: text/yaml
method: awf.workflow/list
params:
filter:
ilike: import
result:
resources:
- definition: aidbox.bulk/import-resource-task
meta:
lastUpdated: '2023-04-24T09:30:51.562261Z'
createdAt: '2023-04-24T09:30:50.888731Z'
versionId: '128371'
params:
type: aidbox
input:
url: >-
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
contentEncoding: gzip
retryCount: 1
outcome: succeeded
resourceType: AidboxTask
requester:
id: >-
38239f30-2e67-45fb-8e67-992c5c1b350e
resourceType: AidboxWorkflow
status: done
result:
imported-resources: 100
execId: ea82769d-e083-461c-8cb0-3427ed466f19
label: >-
Organization
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
id: >-
c9555892-6221-42b4-9b34-1428a18e893result:
resources:
- params:
type: aidbox
inputs:
- url: >-
https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
resourceType: Organization
result:
message: All input files imported, 0 new resources loaded
total-files: 1
total-imported-resources: 0
status: done
outcome: succeeded
definition: aidbox.bulk/import-resources-workflow
id: >-
abbc317d-f9b0-415e-b5b5-df059e000060
resourceType: AidboxWorkflow
meta:
lastUpdated: '2023-05-22T11:55:07.427230Z'
createdAt: '2023-05-22T11:55:06.570348Z'
versionId: '18073'
Last modified 2mo ago