DOVU Operating System
  • Welcome to DOVU OS
  • DOVU Operating System
    • The Problem
    • What is DOVU OS?
    • Core Concepts
    • Charger Protocol
    • Beyond Sustainability
  • Workflow Engine
    • The Engine
    • What to Expect Next
    • API Reference
      • Workflow Blueprints
      • Workflow Block Instance Processing
      • Actor Registration and Roles
      • Credit Warehouse Queries
      • Audit Trails
      • Schema and Data Validation
    • Tutorials and Examples
  • Template Language
    • Rationale
    • At a glance
    • Use Case: ELV Recycling
    • Language Primitives
  • DOVU Guardian Tools
    • Guardian Deployment System
    • Guardian PHP SDK
Powered by GitBook
On this page
  1. Workflow Engine
  2. API Reference

Workflow Block Instance Processing

This section details how to interact with workflow instances by submitting data to different block types within a workflow. It covers both Approval Process Blocks and Data Process Blocks.

PreviousWorkflow BlueprintsNextActor Registration and Roles

Last updated 5 months ago

Submitting Block Types in Workflow Instances Workflow Block instances are the operational units of the DOVU OS Workflow Engine. Within each block instance, block types define specific stages or actions, such as data submission, validation, or approval processes. This section focuses on two primary block types:

  1. Data Process Blocks: These blocks allow users to submit and store structured data related to the workflow. Typical use cases include collecting user information, project details, MRV data, or geographic data necessary for the workflow's progression.

  2. Approval Process Blocks: These blocks facilitate decision-making steps in the workflow. Users can submit approvals or rejections, with optional messages explaining the decision. This ensures compliance and transparency in workflows requiring oversight or multiple stakeholders.

How It Works

  • Each block is tied to a specific workflow instance ID and acts as a modular step in the broader workflow lifecycle.

  • Each block is tied to a specific role that can act on the block, all roles are connected actors that must be prior connected to a workflow instance from the owner or registry actor.

  • Developers can interact with these blocks via POST requests, submitting data that drives the instance forward or changes its state.

  • Responses from these endpoints include metadata about the workflow instance, enabling further actions or integrations.

Key Use Cases:

  • Submitting project data for environmental credit issuance.

  • Approving or rejecting specific workflow stages to ensure compliance.

  • Using returned data for visualization or tracking in front-end applications.

With these endpoints, developers can manage workflow instances dynamically, ensuring seamless integration of data submissions and approvals into the workflow lifecycle.


  • POSTData Process Block
  • POSTApproval Process Block

Data Process Block

post
Authorizations
Header parameters
AcceptstringRequiredExample: application/json
Content-TypestringRequiredExample: application/json
RefererstringRequiredExample: localhost:8000
Body
namestringRequired
ageintegerRequired
Responses
200Success
application/json
401Error
application/json
404Error
application/json
422Error
application/json
post
POST /api/v1/workflow-block-instances/data_workflow_block_instance_id HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: text
Content-Type: application/json
Referer: text
Content-Length: 148

{
  "name": "John Doe",
  "age": 30,
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "postcode": "12345",
    "latlong": {
      "lat": "52.768211",
      "long": "-0.377180"
    }
  }
}
{
  "id": "9daca5c7-6c57-4f3d-ad47-465becd9a422",
  "workflow_instance_id": "9daca5c7-6bf7-4df6-a0ad-519cab9da612",
  "workflow_block_id": "9dab4bc0-f5fa-4817-8880-7d5d532bc11a",
  "block_id": "dbec909b-62c7-492a-91f1-fa52a1f7b6eb",
  "parent_id": null,
  "next_block_instance_id": "9dacac58-477c-4d17-b485-bd81a9a1d703",
  "workflow_id": "9dab4bc0-ef1a-4b8e-aed8-dae4b0c7da8f",
  "schema_id": "9dab4bc0-f043-458b-92c9-d0afefba8266",
  "role_id": "9dab4bbf-096f-426e-af04-af82e4a06247",
  "block_type_id": "2732e230-9953-48bf-a589-53ee56a35d4d",
  "name": "Data",
  "child_id": "9dab4bc0-f68d-46fd-be96-826ed361d070",
  "key": "project_data_block",
  "type": "Data",
  "latest_status_id": 2,
  "updated_at": "2024-12-08T09:18:34.000000Z"
}

Approval Process Block

post
Authorizations
Header parameters
AcceptstringRequiredExample: application/json
Content-TypestringRequiredExample: application/json
RefererstringRequiredExample: localhost:8000
Body
approvestringRequired
messsagestringRequired
Responses
200Success
application/json
401Error
application/json
422Error
application/json
x-422:[Warning] Approval Process Block After Initial modification
application/json
x-422:[Fail] Use Correct Approval Key
application/json
x-422:[Fail] Cannot reprocess block when approved
application/json
post
POST /api/v1/workflow-block-instances/approval_workflow_block_instance_id HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: text
Content-Type: application/json
Referer: text
Content-Length: 69

{
  "approve": "approved",
  "messsage": "this is a approval/reject message"
}
{
  "id": "9dacac58-477c-4d17-b485-bd81a9a1d703",
  "workflow_instance_id": "9daca5c7-6bf7-4df6-a0ad-519cab9da612",
  "workflow_block_id": "9dab4bc0-f68d-46fd-be96-826ed361d070",
  "block_id": "ab8ab8ab-c532-436d-9595-28cbb44610b6",
  "parent_id": "9daca5c7-6c57-4f3d-ad47-465becd9a422",
  "next_block_instance_id": "9dad4fb0-b31d-4be2-b325-54f0f33617c2",
  "workflow_id": "9dab4bc0-ef1a-4b8e-aed8-dae4b0c7da8f",
  "schema_id": null,
  "role_id": "9dab4bbf-09fe-44f4-b3e8-e6789ddf7958",
  "block_type_id": "d8c1a15f-38a4-45aa-b452-1ce27ee56044",
  "name": "Approval",
  "child_id": "9dab4bc0-f783-40d0-80f8-1995828c8ff5",
  "key": "project_approval_block",
  "type": "Decision",
  "latest_status_id": 9,
  "updated_at": "2024-12-08T16:55:18.000000Z"
}