Workflow API
Workflow API wraps Form API and when you use WF you don't need to use Form API directly
get-workflow - get workflow definition
get-workflows - return existed workflows
start-workflow - start WF and launch forms
save-step - save document through WF, mark step as in-progress
skip-step - skip WF step
amend-step - amend WF step
complete-step - try complete WF step with document, call sign on it.
complete-workflow - complete WF
cancel-workflow - try cancel WF
amend-workflow - amend completed WF
add-workflow-note - add addendum note to the given WF
get-workflow-addendums - get list of addendums for the given WF
get-workflows
Return existed Workflows
Response can be narrowed with Workflow Symbol name substring
params:
Param | Description | Type | required? |
---|---|---|---|
q | substring of Workflow symbolic name | String | yes |
Response:
get-workflow
Get workflow definition by name
Param | Description | Type | required? |
---|---|---|---|
workflow | Workflow Symbol name | String | yes |
Responses:
Error
Success
start-workflow
Launch all forms of the WF and create SDCWorkflow
resource.
Param | Description | Type | required? |
---|---|---|---|
workflow | workflow symbolic name | String | yes |
params | Parameters wich will be propagated to forms | Map<Any,Any> | yes |
dry-run | Run without saving document and extractions | boolean | no |
Result:
save-step
Save document draft without any validations. Mark step and it's parent sections as 'in-progress'
Only steps in new
/in-progress
/in-amendment
statues can be saved through this RPC
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
step | path to nested item | array | yes |
document | document resource | SDCDocument | yes |
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Result:
Error
Success
complete-step
Try complete step with given document. Call sign on that document and extract data. If everything is ok - mark step as completed. If one of the validations fails - returns error
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
step | path to nested item | array | yes |
document | document resource | SDCDocument | yes |
dry-run | Run without saving document and extractions | boolean | no |
If workflow step was:
in
in-progress
status - setcompleted
statusin
in-amendment
status - setamended
status
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Result:
Error
Success
skip-step
Skip step in WF.
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
step | path to nested item | array | yes |
reason | skip reason | string | yes |
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Result:
Error
Success
amend-step
Set in-amendment
status for step and try to amend document.
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
step | path to nested item | array | yes |
dry-run | Try without creating resources in DB | string | no |
Additionally if workflow was in
completed
status - change it status toin-amendment
and creates History addendum with timestamp and user
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Result:
Error
Success
complete-workflow
Complete WF and it's items.
When all items are already completed/skipped - just complete WF.
When some items are not completed - try to sign docs for them and complete.
By default take docments from DB
Also can take documents for signing from parameters - (suitable for Offline mode).
Finalized step is step in
skipped
,completed
oramended
status
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
items | documents in items structure | map | no |
dry-run | Run without saving document in db | boolean | no |
If workflow was:
in
in-progress
status - setcompleted
statusin
in-amendment
status - setamended
status
Additionally creates History addendum for WF with timestamp and user
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Params with direct document placement
If you supply document through parameters - you need to specify them for the whole WF
Result:
Error
Success
cancel-workflow
Tries skip all non-finalized steps and mark WF as canceled.
Finalized step is step in
skipped
,completed
oramended
status
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
reason | cancel reason | string | yes |
dry-run | Run without saving updates in db | boolean | no |
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Result:
Error
Success
amend-workflow
Set in-amendment
status for WF and all completed
/amended
steps.
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | string | yes |
dry-run | Run without saving updates in db | boolean | no |
Additionally creates History Addendum with user and timestamp
Returns patches for workflow or error
patch - pair of
[step, patch-obj]
step - path to item in WF (array)
[] - path for wf root
[section1] - path for section in 1st level
[section1 form1] - path for form, located in 2st level (real path in WF object =
{items: {section1: {items: {form1: {.. form ...}}}}}
)
patch-obj - item object with changed fields (example:
{status: "completed"}
)
Request:
Result:
Error
Success
add-workflow-note
Add Addendum Note to the given Workflow. This is the preferred way to add Notes to Workflows.
Use this API (aidbox.sdc/add-workflow-note
) instead of the low-level Addendum API (aidbox.sdc.addendum/add-note
).
Params:
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | zen/string | yes |
user | Reference to user which adds note | zenbox/Reference | yes |
text | Addendum note text | zen/string | yes |
Request:
Result:
Server responds with HTTP 422 Unprocessable Entity
if wrong workflow id is provided.
Request:
Result:
Error
get-workflow-addendums
Returns collection of addendums for the given workflow.
This is the preferred way to retrieve Addendums related to a Workflow.
Use this API (
aidbox.sdc/get-workflow-addendums
) instead of the low-level Addendum API (aidbox.sdc.addendum/get-addendums
).
Params:
Param | Description | Type | required? |
---|---|---|---|
id | workflow id | zenbox/string | yes |
Request:
Response:
Server responds with HTTP 422 Unprocessable Entity
if wrong id is provided.
Request:
Result:
Error
Last updated