Workflows
Overview
A Workflow
is a prototype collection of stepwise Workstep
prototypes corresponding to a real-world business process. Workflows provide a means of defining the relationships, rulesets and order of execution to be implemented in a baseline business process.
While the baseline protocol standard defines a WorkflowInstance
, the provisioning and management of these instances is left to the implementation provider. Provide Baseline introduces a Workflow
staging layer that enables drafting, templating, deployment and automatic real-time generation of workflow instances. Once deployed, a Workflow
is referenced as a prototype for the spawning of WorkflowInstance
executions as qualifying trigger events occur.
Application
Workflows are useful for designing end-to-end baseline processes as they pertain to a specific use case. Composed of Workstep
objects containing zero-knowledge proofs, a Workflow
can be used to verifiably synchronize the entire lifecycle of any shared business process without exposing any sensitive data.
Fundamentals
Proof
Refers to the output of a zero-knowledge prover; the result of a successfully executed Workstep
. In a baseline context, the proof resulting from a completed workflow instance provides verifiable proof that the data shared by participants in the workflow remained synchronized throughout the entire process.
Workflows are composed of individual stepwise processes called worksteps. A workstep is characterized by input, the deterministic application of a set of logic rules and data to that input, and the generation of a verifiably deterministic and verifiably correct output. Worksteps output a proof
by way of a prover
.
Workflow Instance
A workflow instance is a real-time execution of a deployed workflow. Workflow instances are spawned when conditions specified in the prime-workstep trigger are met. A Workflow
is capable of spawning n number of workflow instances. A WorkflowInstance
is distinguishable from a Workflow
by the presence of a value in the workflow_id
field.
Workflow Lifecycle
Status
is used to define the stages in a workflow lifecycle.
draft
inactive; is not being referenced by any workflow instances or spawning new workflow instances.
pending_deployment
deployment initialized. Included worksteps provisioning.
deployed
active; able to spawn a WorkflowInstance
as trigger events occur. Deployed workflows cannot be edited and must be versioned to create changes
deprecated
inactive; has been replaced by a new version or removed from use
Versioning
When updates are needed for a deployed Workflow
, versioning is required to avoid conflicts with previously deployed iterations and related workflow instances. A Workflow
is required to have a version in order to be deployed.
Using Workflows
Prerequisites
The Workflow API is intended to function within the context of an Organization
acting as a participant in a Workgroup
.
Within this context, it is assumed that:
an
Organization
scoped JWT is available for useOrganization
is a participant in aWorkgroup
Workflow Schema
created_at
date/time
timestamp of Workflow
creation
deployed_at
date/time
timestamp of Workflow
deployment
id
uuid
id
of Workflow
metadata
object
arbitrary data pertaining to Workflow
participants
array
list of Participant
objects included in a Workflow
shield
string
address of shield
contract
status
string
current Workflow
status
version
string
current Workflow
version; required for deployment
workgroup_id
uuid
id
of target Workgroup
workflow_id
uuid
when null
, indicates record is Workflow
. Non-null value indicates record is a WorkflowInstance
worksteps
array
list of Workstep
objects included in a Workflow
API Requests
List Workflows
Returns a list of Workflow
objects
List Workflows
GET
https://baseline.provide.services/api/v1/workflows
Returns a list of workflows and workflow instances
Query Parameters
filter_prototypes
boolean
when true, only workflow instances will be returned
filter_instances
boolean
when true, only Workflow
prototypes will be returned
page
int
limits response to the page number specified
rpp
int
sets the number of results included per page
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Create Workflow
Creates a Workflow
Create Workflow
POST
https://baseline.provide.services/api/v1/workflows
Creates a Workflow
.
A Workflow
is a prototype of a baseline business process, typically shared amongst two or more participants and composed of one or more stepwise worksteps. Once deployed, a Workflow
is referenced as the template for real-time WorkflowInstance
generation as conditions defined in the prime-workstep occur.
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Request Body
name*
string
name of Workflow
description
string
descriptor of Workflow
workgroup_id*
uuid
id of intended Workgroup
status*
string
current status of Workflow
. Can be draft
, pending_deployment
, deployed
or deprecated
version
string
current Workflow
version. Required for deployment
Get Workflow Details
Retrieves details for a specified Workflow
Get Workflow Details
GET
https://baseline.provide.services/api/v1/workflows/:id
Retrieves detailed information for a specified Workflow
. ID path parameter can optionally be replaced with a WorkflowInstance
id
to obtain information about a specified WorkflowInstance
.
Path Parameters
id*
uuid
id
of Workflow
or for which detailed information is desired
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Delete Workflow
Deletes a specified Workflow
; Workflows with a status of pending_deployment
, deployed
or deprecated
cannot be deleted.
Delete a Workflow
DELETE
https://baseline.provide.services/api/v1/workflows/:id
Deletes the specified Workflow
Path Parameters
id*
uuid
id
of workflow
to be deleted
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Deploy Workflow
Deploying a workflow provisions it for use amongst the participants in the associated workgroup within the defined parameters.
Once deployed, a workflow begins actively listening for workstep trigger events, spawning new workflow instance executions each time the prime-workstep is triggered. A deployed Workflow
cannot be updated and must be versioned and redeployed to introduce changes.
Deploy a Workflow
POST
https://baseline.provide.services/api/v1/workflows/:id/deploy
Deploys a specified Workflow.
Workflow
must be assigned a version
in order to be deployed.
Path Parameters
id*
uuid
id
of workflow
to be deployed
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Update Workflow
Updating a Workflow
is useful for versioning and updating status. Workflows with a status of pending_deployment
, deployed
or deprecated
cannot be updated.
Update a Workflow
PUT
https://baseline.provide.services/api/v1/workflows/:id
Updates a specified Workflow
. Useful for versioning and updating status.
Path Parameters
id*
uuid
id
of specified Workflow
to be updated
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Request Body
version
string
current Workflow
version
status*
string
current status of workflow
. Can be draft
, pending_deployment
, deployed
or deprecated
name*
string
workflow name
description
string
brief description of Workflow
List Workflow Worksteps
Returns a list of Workstep
objects in a specified Workflow
List Worksteps in a Workflow
PUT
https://baseline.provide.services/api/v1/workflows/:id/worksteps
Returns a list of Workstep
objects for a specified Workflow
Path Parameters
id*
uuid
id
of specified Workflow
or WorkflowInstance
for which a list of worksteps is desired
Headers
authorization*
string
bearer <JWT> scoped for an Organization
Last updated