a9cd7750f4
CI / unit-test (push) Has been cancelled
CI / detect-changes (push) Has been cancelled
CI / build (push) Has been cancelled
Publish docs via GitHub Pages / Deploy docs (push) Has been cancelled
CI / test-harness (push) Has been cancelled
CI / generate-e2e-matrix (push) Has been cancelled
CI / e2e (push) Has been cancelled
CI / build-ui (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
UI v2 Integration CI / E2E (Integration) (push) Has been cancelled
UI v2 CI / Lint, Format & Test (push) Has been cancelled
UI v2 CI / E2E (Mocked) (push) Has been cancelled
52 lines
1.7 KiB
JSON
52 lines
1.7 KiB
JSON
{
|
|
"name": "dowhile_demo_workflow",
|
|
"description": "Scheduled workflow that uses DO_WHILE to poll timeapi.io 3 times, once per iteration. Demonstrates a scheduled workflow with internal looping — useful for retry patterns, polling until ready, or bounded sampling.",
|
|
"version": 2,
|
|
"tasks": [
|
|
{
|
|
"name": "poll_loop",
|
|
"taskReferenceName": "poll_loop",
|
|
"type": "DO_WHILE",
|
|
"loopCondition": "if ($.iteration < 3) { true; } else { false; }",
|
|
"inputParameters": {
|
|
"iteration": "${poll_loop.output.iteration}"
|
|
},
|
|
"loopOver": [
|
|
{
|
|
"name": "fetch_current_time",
|
|
"taskReferenceName": "fetch_current_time",
|
|
"type": "HTTP",
|
|
"inputParameters": {
|
|
"http_request": {
|
|
"uri": "https://timeapi.io/api/time/current/zone?timeZone=UTC",
|
|
"method": "GET",
|
|
"connectionTimeOut": 5000,
|
|
"readTimeOut": 5000
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "summarize",
|
|
"taskReferenceName": "summarize",
|
|
"type": "INLINE",
|
|
"inputParameters": {
|
|
"lastTime": "${poll_loop.output.3.fetch_current_time.response.body.dateTime}",
|
|
"totalIterations": "${poll_loop.output.iteration}",
|
|
"evaluatorType": "javascript",
|
|
"expression": "({ sampledAt: $.lastTime, iterations: $.totalIterations })"
|
|
}
|
|
}
|
|
],
|
|
"outputParameters": {
|
|
"sampledAt": "${summarize.output.result.sampledAt}",
|
|
"iterations": "${summarize.output.result.iterations}"
|
|
},
|
|
"schemaVersion": 2,
|
|
"restartable": true,
|
|
"ownerEmail": "demo@example.com",
|
|
"timeoutPolicy": "ALERT_ONLY",
|
|
"timeoutSeconds": 120
|
|
}
|