Skip to content

Workflow DSL Reference

Triggerfish ನ workflow engine ನಲ್ಲಿ implement ಮಾಡಿದ CNCF Serverless Workflow DSL 1.0 ಗಾಗಿ complete reference. Usage guide ಮತ್ತು examples ಗಾಗಿ Workflows ನೋಡಿ.

Document Structure

ಪ್ರತಿ workflow YAML ಗೆ top-level document field ಮತ್ತು do block ಇರಬೇಕು.

yaml
document:
  dsl: "1.0"
  namespace: my-namespace
  name: my-workflow
  version: "1.0.0"            # optional
  description: "What it does"  # optional
classification_ceiling: INTERNAL  # optional
input:                            # optional
  from: "${ . }"
output:                           # optional
  from:
    result: "${ .final_step }"
timeout:                          # optional
  after: PT5M
do:
  - task_name:
      # task definition

Document Metadata

FieldTypeRequiredವಿವರಣೆ
dslstringಹೌದುDSL version. "1.0" ಆಗಿರಬೇಕು
namespacestringಹೌದುLogical grouping (ಉದಾ., ops, reports)
namestringಹೌದುNamespace ಒಳಗೆ unique workflow name
versionstringಇಲ್ಲSemantic version string
descriptionstringಇಲ್ಲHuman-readable ವಿವರಣೆ

Top-Level Fields

FieldTypeRequiredವಿವರಣೆ
documentobjectಹೌದುDocument metadata (ಮೇಲೆ ನೋಡಿ)
doarrayಹೌದುTask entries ನ ordered list
classification_ceilingstringಇಲ್ಲExecution ಸಮಯದಲ್ಲಿ maximum allowed session taint
inputtransformಇಲ್ಲWorkflow input ಗೆ apply ಮಾಡಿದ transform
outputtransformಇಲ್ಲWorkflow output ಗೆ apply ಮಾಡಿದ transform
timeoutobjectಇಲ್ಲWorkflow-level timeout (after: <ISO 8601>)
metadataobjectಇಲ್ಲArbitrary key-value metadata

Task Entry Format

do block ನ ಪ್ರತಿ entry single-key object. Key task name, value task definition.

yaml
do:
  - my_task_name:
      call: http
      with:
        endpoint: "https://example.com"

Task names ಒಂದೇ do block ನಲ್ಲಿ unique ಆಗಿರಬೇಕು. Task result data context ನಲ್ಲಿ task name ಅಡಿಯಲ್ಲಿ store ಮಾಡಲ್ಪಡುತ್ತದೆ.


Common Task Fields

ಎಲ್ಲ task types ಈ optional fields share ಮಾಡುತ್ತವೆ:

FieldTypeವಿವರಣೆ
ifstringExpression condition. Falsy ಆದಾಗ task skip.
inputtransformTask execution ಮೊದಲು apply ಮಾಡಿದ transform
outputtransformTask execution ನಂತರ apply ಮಾಡಿದ transform
timeoutobjectTask timeout: after: <ISO 8601 duration>
thenstringFlow directive: continue, end, ಅಥವಾ task name
metadataobjectArbitrary key-value metadata. Self-healing enable ಮಾಡಿದಾಗ description, expects, produces ಬೇಕು.

Self-Healing Configuration

metadata.triggerfish.self_healing block workflow ಗಾಗಿ autonomous healing agent enable ಮಾಡುತ್ತದೆ. Full guide ಗಾಗಿ Self-Healing ನೋಡಿ.

yaml
metadata:
  triggerfish:
    self_healing:
      enabled: true
      retry_budget: 3
      approval_required: true
      pause_on_intervention: blocking_only
      pause_timeout_seconds: 300
      pause_timeout_policy: escalate_and_halt
      notify_on: [intervention, escalation, approval_required]
FieldTypeRequiredDefaultವಿವರಣೆ
enabledbooleanಹೌದುHealing agent enable
retry_budgetnumberಇಲ್ಲ3Max intervention attempts
approval_requiredbooleanಇಲ್ಲtrueFixes ಗಾಗಿ human approval ಅಗತ್ಯ
pause_on_interventionstringಇಲ್ಲ"blocking_only"always | never | blocking_only
pause_timeout_secondsnumberಇಲ್ಲ300Timeout policy fire ಮೊದಲು seconds
pause_timeout_policystringಇಲ್ಲ"escalate_and_halt"escalate_and_halt | escalate_and_skip | escalate_and_fail
notify_onarrayಇಲ್ಲ[]intervention | escalation | approval_required

Step Metadata (Self-Healing Enable ಮಾಡಿದಾಗ Required)

self_healing.enabled true ಆಗಿದ್ದಾಗ, ಪ್ರತಿ task ಈ metadata fields ಒಳಗೊಂಡಿರಬೇಕು. ಯಾವುದಾದರೂ missing ಇದ್ದರೆ parser workflow reject ಮಾಡುತ್ತದೆ.

FieldTypeವಿವರಣೆ
descriptionstringStep ಏನು ಮಾಡುತ್ತದೆ ಮತ್ತು ಏಕೆ
expectsstringಅಗತ್ಯ input shape ಅಥವಾ preconditions
producesstringGenerate ಮಾಡಿದ output shape
yaml
- fetch-invoices:
    call: http
    with:
      endpoint: "https://api.example.com/invoices"
    metadata:
      description: "Fetch open invoices from billing API"
      expects: "API available, returns JSON array"
      produces: "Array of {id, amount, status} objects"

Task Types

call

HTTP endpoint ಅಥವಾ Triggerfish service ಗೆ dispatch ಮಾಡಿ.

FieldTypeRequiredವಿವರಣೆ
callstringಹೌದುCall type (ಕೆಳಗಿನ dispatch table ನೋಡಿ)
withobjectಇಲ್ಲTarget tool ಗೆ pass ಮಾಡಿದ arguments
yaml
- fetch:
    call: http
    with:
      endpoint: "https://api.example.com/data"
      method: GET

run

Shell command, inline script, ಅಥವಾ sub-workflow execute ಮಾಡಿ. run field ಗೆ shell, script, ಅಥವಾ workflow ಒಂದಕ್ಕಿಂತ ಹೆಚ್ಚು ಇರಬಾರದು.

Shell:

FieldTypeRequiredವಿವರಣೆ
run.shell.commandstringಹೌದುExecute ಮಾಡಬೇಕಾದ shell command
run.shell.argumentsobjectಇಲ್ಲNamed arguments
run.shell.environmentobjectಇಲ್ಲEnvironment variables

Script:

FieldTypeRequiredವಿವರಣೆ
run.script.languagestringಹೌದುScript language
run.script.codestringಹೌದುInline script code
run.script.argumentsobjectಇಲ್ಲNamed arguments

Sub-workflow:

FieldTypeRequiredವಿವರಣೆ
run.workflow.namestringಹೌದುSaved workflow ನ name
run.workflow.versionstringಇಲ್ಲVersion constraint
run.workflow.inputobjectಇಲ್ಲSub-workflow ಗಾಗಿ input data

set

Data context ಗೆ values assign ಮಾಡಿ.

FieldTypeRequiredವಿವರಣೆ
setobjectಹೌದುAssign ಮಾಡಬೇಕಾದ key-value pairs. Values expressions ಆಗಬಹುದು.
yaml
- prepare:
    set:
      full_name: "${ .first_name } ${ .last_name }"
      count: 0

switch

Conditional branching. switch field case entries ನ array. ಪ್ರತಿ case key case name ಆಗಿರುವ single-key object.

Case fieldTypeRequiredವಿವರಣೆ
whenstringಇಲ್ಲExpression condition. Default case ಗಾಗಿ omit.
thenstringಹೌದುFlow directive: continue, end, ಅಥವಾ task name

Cases ಕ್ರಮದಲ್ಲಿ evaluate ಮಾಡಲ್ಪಡುತ್ತವೆ. Truthy when (ಅಥವಾ when ಇಲ್ಲ) ಇರುವ ಮೊದಲ case take ಆಗುತ್ತದೆ.

yaml
- route:
    switch:
      - high:
          when: "${ .priority > 7 }"
          then: alert_team
      - low:
          then: log_only

for

Collection ಮೇಲೆ iterate ಮಾಡಿ.

FieldTypeRequiredವಿವರಣೆ
for.eachstringಹೌದುCurrent item ಗಾಗಿ variable name
for.instringಹೌದುCollection reference ಮಾಡುವ expression
for.atstringಇಲ್ಲCurrent index ಗಾಗಿ variable name
doarrayಹೌದುಪ್ರತಿ iteration ನಲ್ಲಿ execute ಮಾಡಿದ nested task list
yaml
- process_all:
    for:
      each: item
      in: "${ .items }"
      at: idx
    do:
      - handle:
          call: triggerfish:llm
          with:
            task: "Process item ${ .idx }: ${ .item.name }"

raise

Structured error ಜೊತೆ workflow halt ಮಾಡಿ.

FieldTypeRequiredವಿವರಣೆ
raise.error.statusnumberಹೌದುHTTP-style status code
raise.error.typestringಹೌದುError type URI/string
raise.error.titlestringಹೌದುHuman-readable title
raise.error.detailstringಇಲ್ಲDetailed error message
yaml
- abort:
    raise:
      error:
        status: 422
        type: "validation-error"
        title: "Invalid input"
        detail: "Field 'email' is required"

emit

Workflow event record ಮಾಡಿ. Events run result ನಲ್ಲಿ store ಮಾಡಲ್ಪಡುತ್ತವೆ.

FieldTypeRequiredವಿವರಣೆ
emit.event.typestringಹೌದುEvent type identifier
emit.event.sourcestringಇಲ್ಲEvent source URI
emit.event.dataobjectಇಲ್ಲEvent payload
yaml
- record:
    emit:
      event:
        type: "step.completed"
        source: "workflow/pipeline"
        data:
          step: "transform"
          duration_ms: 1200

wait

Duration ಗಾಗಿ execution pause ಮಾಡಿ.

FieldTypeRequiredವಿವರಣೆ
waitstringಹೌದುISO 8601 duration (ಉದಾ., PT5S)

Common durations: PT1S (1 second), PT30S (30 seconds), PT1M (1 minute), PT5M (5 minutes).


Call Dispatch Table

call field value ಅನ್ನು actually invoke ಮಾಡಲ್ಪಡುವ Triggerfish tool ಗೆ map ಮಾಡುತ್ತದೆ.

call valueTool invokedRequired with: fields
httpweb_fetchendpoint ಅಥವಾ url; optional method, headers, body
triggerfish:llmllm_taskprompt ಅಥವಾ task; optional tools, max_iterations
triggerfish:agentsubagentprompt ಅಥವಾ task; optional tools, agent
triggerfish:memorymemory_*operation (save/search/get/list/delete) + operation fields
triggerfish:web_searchweb_searchquery; optional max_results
triggerfish:web_fetchweb_fetchurl; optional method, headers, body
triggerfish:mcpmcp__<server>__<tool>server, tool; optional arguments
triggerfish:messagesend_messagechannel, text; optional recipient

Unsupported CNCF call types (grpc, openapi, asyncapi) error return ಮಾಡುತ್ತವೆ.


Expression Syntax

Expressions ${ } ನಿಂದ delimit ಮಾಡಲ್ಪಡುತ್ತವೆ ಮತ್ತು workflow data context ವಿರುದ್ಧ resolve ಮಾಡಲ್ಪಡುತ್ತವೆ.

Dot-Path Resolution

SyntaxವಿವರಣೆExample result
${ . }ಸಂಪೂರ್ಣ data context{...}
${ .key }Top-level key"value"
${ .a.b.c }Nested key"deep value"
${ .items[0] }Array index{...first item...}
${ .items[0].name }Array index ನಂತರ key"first"

Leading dot (ಅಥವಾ $.) path ಅನ್ನು context root ನಲ್ಲಿ anchor ಮಾಡುತ್ತದೆ. undefined ಗೆ resolve ಮಾಡುವ paths interpolate ಆಗಿದ್ದಾಗ empty string produce ಮಾಡುತ್ತವೆ, standalone value ಆಗಿ ಬಳಸಿದಾಗ undefined.

Operators

TypeOperatorsExample
Comparison==, !=, >, <, >=, <=${ .count > 0 }
Arithmetic+, -, *, /, %${ .price * .quantity }

Comparison expressions true ಅಥವಾ false return ಮಾಡುತ್ತವೆ. Arithmetic expressions number return ಮಾಡುತ್ತವೆ (operand numeric ಅಲ್ಲದಿದ್ದರೆ ಅಥವಾ division by zero ಆದರೆ undefined).

Literals

TypeExamples
String"hello", 'hello'
Number42, 3.14, -1
Booleantrue, false
Nullnull

Interpolation Modes

Single expression (raw value): ಸಂಪೂರ್ಣ string ಒಂದೇ ${ } expression ಆದಾಗ, raw typed value return ಮಾಡಲ್ಪಡುತ್ತದೆ (number, boolean, object, array).

yaml
count: "${ .items.length }"  # number return ಮಾಡುತ್ತದೆ, string ಅಲ್ಲ

Mixed / multiple expressions (string): ${ } expressions text ಜೊತೆ mixed ಆದಾಗ ಅಥವಾ multiple expressions ಇದ್ದಾಗ, result ಯಾವಾಗಲೂ string.

yaml
message: "Found ${ .count } items in ${ .category }"  # string return ಮಾಡುತ್ತದೆ

Truthiness

if: conditions ಮತ್ತು switch when: expressions ಗಾಗಿ, values JavaScript-style truthiness ಬಳಸಿ evaluate ಮಾಡಲ್ಪಡುತ್ತವೆ:

ValueTruthy?
trueಹೌದು
Non-zero numberಹೌದು
Non-empty stringಹೌದು
Non-empty arrayಹೌದು
Objectಹೌದು
false, 0, "", null, undefined, empty arrayಇಲ್ಲ

Input/Output Transforms

Transforms tasks ಗೆ ಮತ್ತು tasks ನಿಂದ flow ಮಾಡುವ data reshape ಮಾಡುತ್ತವೆ.

input

Task execution ಮೊದಲು apply ಮಾಡಲ್ಪಡುತ್ತದೆ. Task ನ data context ವೀಕ್ಷಣೆ replace ಮಾಡುತ್ತದೆ.

yaml
- step:
    call: http
    input:
      from: "${ .config }"       # task ಕೇವಲ config object ನೋಡುತ್ತದೆ
    with:
      endpoint: "${ .api_url }"  # config object ವಿರುದ್ಧ resolve

from as string: ಸಂಪೂರ್ಣ input context replace ಮಾಡುವ expression.

from as object: ಹೊಸ keys ಅನ್ನು expressions ಗೆ map ಮಾಡುತ್ತದೆ:

yaml
input:
  from:
    url: "${ .config.api_url }"
    token: "${ .secrets.api_token }"

output

Task execution ನಂತರ apply ಮಾಡಲ್ಪಡುತ್ತದೆ. Task name ಅಡಿಯಲ್ಲಿ context ನಲ್ಲಿ store ಮಾಡುವ ಮೊದಲು result reshape ಮಾಡುತ್ತದೆ.

yaml
- fetch:
    call: http
    output:
      from:
        items: "${ .fetch.data.results }"
        count: "${ .fetch.data.total }"

Flow Directives

ಯಾವುದೇ task ನ then field task complete ಆದ ನಂತರ execution flow control ಮಾಡುತ್ತದೆ.

ValueBehavior
continueSequence ನ ಮುಂದಿನ task ಗೆ ಮುಂದುವರೆಯಿರಿ (default)
endWorkflow ನಿಲ್ಲಿಸಿ. Status: completed.
<task name>Named task ಗೆ jump ಮಾಡಿ. Task ಒಂದೇ do block ನಲ್ಲಿ exist ಆಗಬೇಕು.

Switch cases ತಮ್ಮ then field ನಲ್ಲಿ flow directives ಬಳಸುತ್ತವೆ.


Classification Ceiling

Execution ಸಮಯದಲ್ಲಿ maximum session taint restrict ಮಾಡುವ optional field.

yaml
classification_ceiling: INTERNAL
Valueಅರ್ಥ
PUBLICಯಾವುದೇ classified data access ಮಾಡಿದರೆ workflow halt
INTERNALPUBLIC ಮತ್ತು INTERNAL data allow
CONFIDENTIALCONFIDENTIAL ತನಕ data allow
RESTRICTEDಎಲ್ಲ classification levels allow
(omitted)Ceiling enforce ಮಾಡಲ್ಪಡುವುದಿಲ್ಲ

Ceiling ಪ್ರತಿ task ಮೊದಲು check ಮಾಡಲ್ಪಡುತ್ತದೆ. Session taint ceiling ದಾಟಿದ್ದರೆ (ಉದಾ. prior task classified data access ಮಾಡಿದ ಕಾರಣ), workflow failed status ಮತ್ತು Workflow classification ceiling breached error ಜೊತೆ halt ಮಾಡುತ್ತದೆ.


Storage

Workflow Definitions

Key prefix workflows:{name} ಜೊತೆ store ಮಾಡಲ್ಪಡುತ್ತವೆ. ಪ್ರತಿ stored record:

FieldTypeವಿವರಣೆ
namestringWorkflow name
yamlstringRaw YAML definition
classificationstringSave ಸಮಯದಲ್ಲಿ classification level
savedAtstringISO 8601 timestamp
descriptionstringOptional ವಿವರಣೆ

Run History

Key prefix workflow-runs:{runId} ಜೊತೆ store. ಪ್ರತಿ run record:

FieldTypeವಿವರಣೆ
runIdstringಈ execution ಗಾಗಿ UUID
workflowNamestringExecute ಮಾಡಿದ workflow ನ name
statusstringcompleted, failed, ಅಥವಾ cancelled
outputobjectFinal data context (internal keys filtered)
eventsarrayExecution ಸಮಯದಲ್ಲಿ emit ಮಾಡಿದ events
errorstringError message (status failed ಆದರೆ)
startedAtstringISO 8601 timestamp
completedAtstringISO 8601 timestamp
taskCountnumberWorkflow ನ tasks ಸಂಖ್ಯೆ
classificationstringCompletion ನಲ್ಲಿ session taint

Limits

LimitValueವಿವರಣೆ
Sub-workflow max depth5run.workflow calls ನ maximum nesting
Run history default limit10workflow_history ಗಾಗಿ default limit

Execution Statuses

Statusವಿವರಣೆ
pendingWorkflow create ಮಾಡಲ್ಪಟ್ಟಿದೆ ಆದರೆ start ಮಾಡಿಲ್ಲ
runningWorkflow ಪ್ರಸ್ತುತ executing ಮಾಡುತ್ತಿದೆ
completedಎಲ್ಲ tasks successfully finish (then: end ಸಹ)
failedTask failed, raise hit ಆಗಿದೆ, ಅಥವಾ ceiling breach ಆಗಿದೆ
cancelledExecution externally cancel ಮಾಡಲ್ಪಟ್ಟಿದೆ