Search…
⌃K

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.

Workstep

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.
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.
Status
Description
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 use
  • Organization is a participant in a Workgroup

Workflow Schema

Field
Type
Description
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
get
https://baseline.provide.services
/api/v1/workflows
List Workflows

Create Workflow

Creates a Workflow
post
https://baseline.provide.services
/api/v1/workflows
Create Workflow

Get Workflow Details

Retrieves details for a specified Workflow
get
https://baseline.provide.services
/api/v1/workflows/:id
Get Workflow Details

Delete Workflow

Deletes a specified Workflow; Workflows with a status of pending_deployment, deployed or deprecated cannot be deleted.
delete
https://baseline.provide.services
/api/v1/workflows/:id
Delete a Workflow

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.
post
https://baseline.provide.services
/api/v1/workflows/:id/deploy
Deploy a Workflow

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.
put
https://baseline.provide.services
/api/v1/workflows/:id
Update a Workflow

List Workflow Worksteps

Returns a list of Workstep objects in a specified Workflow
put
https://baseline.provide.services
/api/v1/workflows/:id/worksteps
List Worksteps in a Workflow