Skip to content

Draft: Start Workflow Execution

Sri Rang requested to merge sri19/9-introduce-workflows into main

Objective

Start a (minimalist) workflow execution (and for that end shape the structure of the gRPC service)

Related issues

Highlights

  • gRPC contract updates
  • Controllers
  • Workflow Execution Loop

gRPC contract updates

  • ExecuteWorkflow is a bidirectional streaming RPC that allows the DuoWorkflowExecutor to send a ExecuteWorkflowRequest message and receive ExecuteWorkflowResponse messages.

  • ExecuteWorkflowRequest — Requests DuoWorkflowExecutor may send to the DuoWorkflowService

    • StartWorkflow — Create and start a new workflow
    • CommandResult — Send results of a command execution to the DuoWorkflowService
    • RestartWorkflow — Restarts a workflow execution optionally from Checkpoint ID
  • ExecuteWorkflowResponse — Responses DuoWorkflowService may send to the DuoWorkflowExecutor

    • ExecuteCommand — Instruct DuoWorkflowExecutor to execute a script or binary
    • HttpRequestCommand — Instruct DuoWorkflowExecutor to make an HTTP request
    • ReadFileCommand — Instruct DuoWorkflowExecutor to read a file
    • WriteFileCommand — Instruct DuoWorkflowExecutor to write a file
    • WorkflowCreated — Notify DuoWorkflowExecutor that a new workflow has been created
    • WorkflowCheckpointed — Notify DuoWorkflowExecutor that a workflow has been checkpointed
    • WorkflowCompleted — Notify DuoWorkflowExecutor that a workflow has been completed

Controllers

  • gRPC service has only one long-running, bi-directional endpoint
  • "Routing" is done based on requests to this endpoint
  • We use "Controllers" as a pattern to distribute implementation while maintaining familiarity humans working on this code-base
  • To be implemented in this MR:
    • StartWorkflow
  • To be scaffolded in this MR
    • CommandResult
    • RestartWorkflow

Workflow execution loop

  • Logic for centralised execution loop for each workflow
  • Triggered by all/most controllers
Edited by Sri Rang

Merge request reports