Design Proposal: Extensions Pipeline for CompleteTaskStep
#9
mushrafmim
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This proposal introduces an Extensions Pipeline within
CompleteTaskStep. The goal is to support custom behaviors—such as authentication/authorization, input schema validation, request filtering, and audit logging—without modifying or cluttering the core task orchestration logic.1. Architectural Design & Lifecycle Phases
To maintain reliability, extensions are executed in two distinct phases relative to
TaskDone(the point at which the task's child workflow is resumed in Temporal):Phase A:
PRE_RESUME(Before DB Save & Resume)Phase B:
POST_RESUME(After DB Save & Resume)2. Interface Definition
A single interface with a
Phaseparameter is recommended. This allows a single extension implementation to orchestrate actions and preserve context across both lifecycle phases if needed.3. Configuration & Registration
Extensions are configured directly in the subtask template and mapped inside the task orchestrator's registry.
SubTaskTemplate Schema
{ "id": "submit_payment_details", "task_type": "USER_INPUT", "output_namespace": "payment_info", "extensions": [ { "id": "role-auth-gate", "phase": "PRE_RESUME", "properties": { "required_roles": ["finance_officer"] } }, { "id": "audit-logger", "phase": "POST_RESUME" } ] }Go Configuration Structs
4. Execution Flow in
CompleteTaskStepAll reactions