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.

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.

StatusDescription

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

FieldTypeDescription

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

NameTypeDescription

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

NameTypeDescription

authorization*

string

bearer <JWT> scoped for an Organization

[
    {
        "id": "7279f7a7-6976-4d10-869b-36a15c8eeac6",
        "created_at": "2021-11-26T16:45:30.364582Z",
        "status": "draft",
        "version": null,
        "name": "test",
        "participants": null,
        "workgroup_id": "a746d83d-6d5e-4d41-9588-300e7e7ff0bc",
        "workflow_id": null
    }
]

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

NameTypeDescription

authorization*

string

bearer <JWT> scoped for an Organization

Request Body

NameTypeDescription

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

{
    "id": "7279f7a7-6976-4d10-869b-36a15c8eeac6",
    "created_at": "2021-11-26T16:45:30.364582373Z",
    "status": "draft",
    "version": null,
    "name": "test",
    "participants": null,
    "workgroup_id": "a746d83d-6d5e-4d41-9588-300e7e7ff0bc",
    "workflow_id": null
}

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

NameTypeDescription

id*

uuid

id of Workflow or for which detailed information is desired

Headers

NameTypeDescription

authorization*

string

bearer <JWT> scoped for an Organization

{
    // Response
}

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

NameTypeDescription

id*

uuid

id of workflow to be deleted

Headers

NameTypeDescription

authorization*

string

bearer <JWT> scoped for an Organization

{
    // Response
}

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

NameTypeDescription

id*

uuid

id of workflow to be deployed

Headers

NameTypeDescription

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

NameTypeDescription

id*

uuid

id of specified Workflow to be updated

Headers

NameTypeDescription

authorization*

string

bearer <JWT> scoped for an Organization

Request Body

NameTypeDescription

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

NameTypeDescription

id*

uuid

id of specified Workflow or WorkflowInstance for which a list of worksteps is desired

Headers

NameTypeDescription

authorization*

string

bearer <JWT> scoped for an Organization

[
    {
        "id": "67b6e39b-7f7b-4468-a869-165a109fc19f",
        "created_at": "2022-01-04T03:42:53.625704Z",
        "name": "models",
        "cardinality": 1,
        "deployed_at": "2022-01-04T03:43:07.887368Z",
        "metadata": {
            "prover": {
                "identifier": "cubic",
                "name": "protocol",
                "provider": "gnark",
                "proving_scheme": "groth16",
                "curve": "BN254"
            }
        },
        "prover_id": "8199355d-a55f-416f-91a4-07e9a4d45c17",
        "require_finality": true,
        "status": "deployed",
        "workflow_id": "0482d6d8-d4b0-4328-bef4-66cf18913d4a",
        "description": null,
        "workstep_id": null
    },
    {
        "id": "87933ff9-87ec-4b0d-bed1-54ff4150d24a",
        "created_at": "2022-01-04T03:42:54.412669Z",
        "name": "TCP",
        "cardinality": 2,
        "deployed_at": "2022-01-04T03:43:10.955804Z",
        "metadata": {
            "prover": {
                "identifier": "cubic",
                "name": "XML",
                "provider": "gnark",
                "proving_scheme": "groth16",
                "curve": "BN254"
            }
        },
        "prover_id": "a22cb470-5897-48d6-86e4-9f66cd8bd893",
        "require_finality": true,
        "status": "deployed",
        "workflow_id": "0482d6d8-d4b0-4328-bef4-66cf18913d4a",
        "description": null,
        "workstep_id": null
    },
    {
        "id": "bb9f3ee8-f58b-43f4-965c-348a2e04606f",
        "created_at": "2022-01-04T03:42:55.128756Z",
        "name": "back-end",
        "cardinality": 3,
        "deployed_at": "2022-01-04T03:43:11.229463Z",
        "metadata": {
            "prover": {
                "identifier": "cubic",
                "name": "Incredible",
                "provider": "gnark",
                "proving_scheme": "groth16",
                "curve": "BN254"
            }
        },
        "prover_id": "54ab13a6-15c1-4548-b501-978940489b38",
        "require_finality": true,
        "status": "deployed",
        "workflow_id": "0482d6d8-d4b0-4328-bef4-66cf18913d4a",
        "description": null,
        "workstep_id": null
    },
    {
        "id": "8886e201-56b4-4b31-94f0-0da19917e8eb",
        "created_at": "2022-01-04T03:42:55.864655Z",
        "name": "Home",
        "cardinality": 4,
        "deployed_at": null,
        "metadata": {
            "prover": {
                "identifier": "cubic",
                "name": "matrix",
                "provider": "gnark",
                "proving_scheme": "groth16",
                "curve": "BN254"
            }
        },
        "prover_id": "2096d846-69c7-443b-8912-8de4ae2709cd",
        "require_finality": true,
        "status": "pending_deployment",
        "workflow_id": "0482d6d8-d4b0-4328-bef4-66cf18913d4a",
        "description": null,
        "workstep_id": null
    },
    {
        "id": "9d8a9055-2d35-40e2-b11b-85c9bab316d0",
        "created_at": "2022-01-04T03:42:56.534909Z",
        "name": "high-level",
        "cardinality": 5,
        "deployed_at": null,
        "metadata": {
            "prover": {
                "identifier": "cubic",
                "name": "Bedfordshire",
                "provider": "gnark",
                "proving_scheme": "groth16",
                "curve": "BN254"
            }
        },
        "prover_id": null,
        "require_finality": true,
        "status": "draft",
        "workflow_id": "0482d6d8-d4b0-4328-bef4-66cf18913d4a",
        "description": null,
        "workstep_id": null
    },
    {
        "id": "5b1f7eb0-fa9b-4553-95a8-b2a60e153f1d",
        "created_at": "2022-01-04T03:42:57.199221Z",
        "name": "withdrawal",
        "cardinality": 6,
        "deployed_at": null,
        "metadata": {
            "prover": {
                "identifier": "cubic",
                "name": "District",
                "provider": "gnark",
                "proving_scheme": "groth16",
                "curve": "BN254"
            }
        },
        "prover_id": null,
        "require_finality": true,
        "status": "draft",
        "workflow_id": "0482d6d8-d4b0-4328-bef4-66cf18913d4a",
        "description": null,
        "workstep_id": null
    }
]

Last updated