Skip to content

Flow Control

Branching, loops, parallelism, subflows, triggers, and error handling.

24 modules

ModuleDescription
กระบวนการชุดประมวลผลรายการเป็นชุดด้วยขนาดที่กำหนดได้
แยกสาขาแยกสาขาตามเงื่อนไขจากการประเมินนิพจน์
จุดพักหยุดการทำงานของเวิร์กโฟลว์เพื่อรอการอนุมัติหรืออินพุตจากผู้ใช้
Circuit Breakerรูปแบบ circuit breaker เพื่อป้องกันความล้มเหลวที่ต่อเนื่อง
คอนเทนเนอร์คอนเทนเนอร์ซับโฟลว์ฝังตัวสำหรับจัดระเบียบเวิร์กโฟลว์ที่ซับซ้อน
Debounceหน่วงการทำงานเพื่อป้องกันการเรียกซ้ำอย่างรวดเร็ว
สิ้นสุดโหนดสิ้นสุดเวิร์กโฟลว์
ตัวจัดการข้อผิดพลาดจับและจัดการข้อผิดพลาดจากโหนดต้นน้ำ
ตัวเรียกเวิร์กโฟลว์ข้อผิดพลาดจุดเริ่มต้นสำหรับเวิร์กโฟลว์ข้อผิดพลาด - เรียกใช้งานเมื่อเวิร์กโฟลว์อื่นล้มเหลว
วนซ้ำแต่ละรายการวนซ้ำรายการและดำเนินการขั้นตอนสำหรับแต่ละรายการ
แยกสาขาแยกการดำเนินการเป็นสาขาคู่ขนาน
ไปที่กระโดดไปยังขั้นตอนอื่นโดยไม่มีเงื่อนไข
Invoke WorkflowExecute an external workflow file
รวมสาขารอให้สาขาคู่ขนานเสร็จสิ้น
วนซ้ำทำซ้ำขั้นตอน N ครั้งโดยใช้การกำหนดเส้นทางพอร์ตเอาต์พุต
รวมรวมอินพุตหลายตัวเป็นเอาต์พุตเดียว
ขนานดำเนินการหลายงานพร้อมกันด้วยกลยุทธ์ที่แตกต่างกัน
จำกัดอัตราจำกัดอัตราการทำงานโดยใช้ token bucket หรือ sliding window
ลองใหม่ลองทำงานที่ล้มเหลวใหม่ด้วยการตั้งค่าการถอยกลับ
เริ่มต้นโหนดเริ่มต้นเวิร์กโฟลว์
ซับโฟลว์อ้างอิงและดำเนินการเวิร์กโฟลว์ภายนอก
สวิตช์แยกสาขาหลายทางตามการจับคู่ค่า
ควบคุมอัตราควบคุมอัตราการทำงานด้วยช่วงเวลาขั้นต่ำ
ทริกเกอร์จุดเริ่มต้นเวิร์กโฟลว์ - แบบแมนนวล, webhook, กำหนดเวลา หรือเหตุการณ์

Modules

กระบวนการชุด

flow.batch

ประมวลผลรายการเป็นชุดด้วยขนาดที่กำหนดได้

Parameters:

NameTypeRequiredDefaultDescription
itemsarrayYes-Array of items to process. Can be numbers, strings, or objects.
batch_sizenumberYes10จำนวนรายการต่อชุด
delay_msnumberNo0มิลลิวินาทีที่ต้องรอระหว่างชุด (สำหรับการจำกัดอัตรา)
continue_on_errorbooleanNoFalseดำเนินการประมวลผลชุดที่เหลือต่อหากมีชุดหนึ่งล้มเหลว
parallel_batchesnumberNo1ดำเนินการประมวลผลชุดที่เหลือต่อหากมีชุดหนึ่งล้มเหลว

Output:

FieldTypeDescription
__event__stringจำนวนชุดที่จะประมวลผลพร้อมกัน (1 สำหรับตามลำดับ)
batcharrayเหตุการณ์สำหรับการกำหนดเส้นทาง (ชุด/เสร็จสิ้น/ข้อผิดพลาด)
batch_indexnumberเหตุการณ์สำหรับการกำหนดเส้นทาง (ชุด/เสร็จสิ้น/ข้อผิดพลาด)
total_batchesnumberรายการในชุดปัจจุบัน
total_itemsnumberดัชนีชุดปัจจุบัน (เริ่มที่ 0)
is_last_batchbooleanจำนวนชุดทั้งหมด
progressobjectจำนวนรายการทั้งหมด

Example: Example

yaml
items: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
batch_size: 10

Example: Example

yaml
items: ${input.records}
batch_size: 100
delay_ms: 1000

Example: Example

yaml
items: ${input.data}
batch_size: 50
parallel_batches: 3
continue_on_error: true

แยกสาขา

flow.branch

แยกสาขาตามเงื่อนไขจากการประเมินนิพจน์

Parameters:

NameTypeRequiredDefaultDescription
conditionstringYes-Expression to evaluate (supports ==, !=, >, <, >=, <=, contains)

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (true/false/error)
outputsobjectค่าเอาต์พุตตามพอร์ต
resultbooleanผลลัพธ์การแยกสาขา
conditionstringค่าเงื่อนไข
resolved_conditionstringผลการประเมินเงื่อนไข

Example: Example

yaml
condition: ${search_step.count} > 0

Example: Example

yaml
condition: ${api_call.status} == success

จุดพัก

flow.breakpoint

หยุดการทำงานของเวิร์กโฟลว์เพื่อรอการอนุมัติหรืออินพุตจากผู้ใช้

Parameters:

NameTypeRequiredDefaultDescription
titlestringNoApproval RequiredTitle displayed to approvers
descriptionstringNo-Optional description text
timeout_secondsnumberNo0Maximum wait time (0 for no timeout)
required_approversarrayYes-Array of data items to process
approval_modeselect (single, all, majority, first)NosingleHow approvals are counted
custom_fieldsarrayYes-Array of data items to process
include_contextbooleanNoTrueWhether to include execution context
auto_approve_conditionstringNo-Text content to process

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (approved/rejected/timeout)
breakpoint_idstringรหัสจุดพัก
statusstringสถานะ
approved_byarrayอนุมัติโดย
rejected_byarrayปฏิเสธโดย
custom_inputsobjectค่าอินพุตที่กำหนดเอง
commentsarrayความเห็นการตรวจสอบ
resolved_atstringเวลาที่แก้ไข
wait_duration_msintegerระยะเวลารอ (มิลลิวินาที)

Example: Example

yaml
title: Approve data export
description: Please review and approve the data export

Example: Example

yaml
title: Manager Approval Required
description: Large transaction requires manager approval
required_approvers: ["manager@example.com"]
timeout_seconds: 3600

Example: Example

yaml
title: Adjustment Required
custom_fields: [{"name": "reason", "label": "Reason", "type": "text", "required": true}, {"name": "amount", "label": "Amount", "type": "number", "required": true}]

Circuit Breaker

flow.circuit_breaker

รูปแบบ circuit breaker เพื่อป้องกันความล้มเหลวที่ต่อเนื่อง

Parameters:

NameTypeRequiredDefaultDescription
failure_thresholdnumberYes5จำนวนความล้มเหลวก่อนที่ circuit จะเปิด
reset_timeout_msnumberNo60000เวลาในมิลลิวินาทีก่อนที่ circuit จะเปลี่ยนเป็นครึ่งเปิด
half_open_maxnumberNo1จำนวนคำขอสูงสุดที่อนุญาตในสถานะครึ่งเปิด

Output:

FieldTypeDescription
__event__stringเหตุการณ์สำหรับการกำหนดเส้นทาง (อนุญาต/ปฏิเสธ/ครึ่งเปิด)
statestringสถานะของ circuit (ปิด/เปิด/ครึ่งเปิด)
failure_countnumberจำนวนความล้มเหลวที่ต่อเนื่อง
last_failure_time_msnumberเวลาของความล้มเหลวครั้งล่าสุดในหน่วยมิลลิวินาที
time_until_half_open_msnumberมิลลิวินาทีก่อนที่ circuit จะเปลี่ยนเป็นครึ่งเปิด

Example: Example

yaml
failure_threshold: 5
reset_timeout_ms: 60000

Example: Example

yaml
failure_threshold: 2
reset_timeout_ms: 10000
half_open_max: 1

Example: Example

yaml
failure_threshold: 20
reset_timeout_ms: 120000
half_open_max: 3

คอนเทนเนอร์

flow.container

คอนเทนเนอร์ซับโฟลว์ฝังตัวสำหรับจัดระเบียบเวิร์กโฟลว์ที่ซับซ้อน

Parameters:

NameTypeRequiredDefaultDescription
subflowobjectNo{'nodes': [], 'edges': []}Embedded workflow definition with nodes and edges
inherit_contextbooleanNoTrueWhether to inherit variables from parent workflow
isolated_variablesarrayYes-Array of data items to process
export_variablesarrayYes-Array of data items to process

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (success/error)
outputsobjectค่าเอาต์พุตตามพอร์ต
subflow_resultobjectผลลัพธ์ซับโฟลว์
exported_variablesobjectตัวแปรที่ส่งออก
node_countintegerจำนวนโหนด
execution_time_msnumberเวลาดำเนินการ (มิลลิวินาที)

Example: Example

yaml
subflow: {"nodes": [], "edges": []}
inherit_context: true

Example: Example

yaml
subflow: {"nodes": [], "edges": []}
inherit_context: false

Debounce

flow.debounce

หน่วงการทำงานเพื่อป้องกันการเรียกซ้ำอย่างรวดเร็ว

Parameters:

NameTypeRequiredDefaultDescription
delay_msnumberYes-เวลารอหลังจากการเรียกครั้งล่าสุดก่อนดำเนินการ
leadingbooleanNoFalseดำเนินการที่ขอบนำ (การเรียกครั้งแรกทำให้เกิดการดำเนินการทันที)
trailingbooleanNoTrueดำเนินการที่ขอบท้าย (หลังจากหมดเวลาหน่วง)

Output:

FieldTypeDescription
__event__stringเหตุการณ์สำหรับการกำหนดเส้นทาง (ดำเนินการ/หน่วง)
last_call_msnumberเวลาของการเรียกครั้งล่าสุดในหน่วยมิลลิวินาที
calls_debouncednumberจำนวนการเรียกที่ถูกหน่วงตั้งแต่การดำเนินการครั้งล่าสุด
time_since_last_msnumberเวลาที่ผ่านไปตั้งแต่การเรียกครั้งล่าสุดในหน่วยมิลลิวินาที
edgestringขอบที่ทำให้เกิดการดำเนินการ (นำ/ท้าย)

Example: Example

yaml
delay_ms: 500

Example: Example

yaml
delay_ms: 1000
leading: true
trailing: false

Example: Example

yaml
delay_ms: 2000
leading: true
trailing: true

สิ้นสุด

flow.end

โหนดสิ้นสุดเวิร์กโฟลว์

Parameters:

NameTypeRequiredDefaultDescription
output_mappingobjectNo{}Map internal variables to workflow output
success_messagestringNo-Text content to process

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (end)
ended_atstringเวลาสิ้นสุด
workflow_resultobjectผลลัพธ์เวิร์กโฟลว์

Example: Example

yaml

Example: Example

yaml
output_mapping: {"result": "${process.output}", "status": "success"}

ตัวจัดการข้อผิดพลาด

flow.error_handle

จับและจัดการข้อผิดพลาดจากโหนดต้นน้ำ

Parameters:

NameTypeRequiredDefaultDescription
actionstringYeslog_and_continueจะทำอย่างไรกับข้อผิดพลาด
include_tracebackbooleanNoTrueรวมการติดตามข้อผิดพลาดเต็มรูปแบบในผลลัพธ์
error_code_mappingobjectNo{}รวมการติดตามข้อผิดพลาดเต็มรูปแบบในผลลัพธ์
fallback_valueanyNo-จับคู่รหัสข้อผิดพลาดกับการกระทำที่กำหนดเอง

Output:

FieldTypeDescription
__event__stringค่าที่จะใช้เมื่อข้อผิดพลาดถูกระงับ
outputsobjectเหตุการณ์สำหรับการกำหนดเส้นทาง (จัดการ/ยกระดับ)
error_infoobjectเหตุการณ์สำหรับการกำหนดเส้นทาง (จัดการ/ยกระดับ)
action_takenstringการกระทำที่ได้ดำเนินการ

Example: Example

yaml
action: log_and_continue
include_traceback: true

Example: Example

yaml
action: suppress
fallback_value: {"status": "skipped", "reason": "upstream_error"}

Example: Example

yaml
action: transform
error_code_mapping: {"TIMEOUT": {"retry": true, "delay": 5000}, "NOT_FOUND": {"skip": true}}

ตัวเรียกเวิร์กโฟลว์ข้อผิดพลาด

flow.error_workflow_trigger

จุดเริ่มต้นสำหรับเวิร์กโฟลว์ข้อผิดพลาด - เรียกใช้งานเมื่อเวิร์กโฟลว์อื่นล้มเหลว

Parameters:

NameTypeRequiredDefaultDescription
descriptionstringNo-Description of this error workflow

Output:

FieldTypeDescription
__event__stringคำอธิบายของเวิร์กโฟลว์ข้อผิดพลาดนี้
error_contextobjectเหตุการณ์สำหรับการกำหนดเส้นทาง (เรียกใช้งาน)
triggered_atstringเวลาประทับ ISO เมื่อเวิร์กโฟลว์ข้อผิดพลาดถูกเรียกใช้งาน

Example: Example

yaml
description: Send Slack notification on workflow failure

Example: Example

yaml
description: Log all workflow errors to monitoring system

วนซ้ำแต่ละรายการ

flow.foreach

วนซ้ำรายการและดำเนินการขั้นตอนสำหรับแต่ละรายการ

Parameters:

NameTypeRequiredDefaultDescription
itemsstringYes-รายการที่จะวนซ้ำ (รองรับการอ้างอิง ${variable})
stepsarrayNo-ขั้นตอนที่จะดำเนินการสำหรับแต่ละรายการ
item_varstringNoitemชื่อตัวแปรสำหรับรายการปัจจุบัน
index_varstringNoindexชื่อตัวแปรสำหรับดัชนีปัจจุบัน
output_modestringNocollectโหมดการรวบรวมผลลัพธ์

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (iterate/done)
__set_contextobjectตั้งค่าบริบท
outputsobjectค่าเอาต์พุตตามพอร์ต
iterationnumberดัชนีการวนซ้ำปัจจุบัน
statusstringสถานะการดำเนินการ
resultsarrayผลลัพธ์ที่รวบรวม
countnumberจำนวนรายการทั้งหมด

Example: Example

yaml
items: ${steps.csv.result.data}

Example: Example

yaml
items: ${search_results}
item_var: element
steps: [{"module": "element.text", "params": {"element_id": "${element}"}, "output": "text"}]

แยกสาขา

flow.fork

แยกการดำเนินการเป็นสาขาคู่ขนาน

Parameters:

NameTypeRequiredDefaultDescription
branch_countnumberNo2Number of parallel branches

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (fork/error)
input_dataanyข้อมูลอินพุต
branch_countintegerจำนวนสาขา

Example: Example

yaml
branch_count: 2

Example: Example

yaml
branch_count: 3

ไปที่

flow.goto

กระโดดไปยังขั้นตอนอื่นโดยไม่มีเงื่อนไข

Parameters:

NameTypeRequiredDefaultDescription
targetstringYes-Step ID to jump to
max_iterationsnumberNo100Maximum number of iterations (prevents infinite loops)

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (goto)
targetstringขั้นตอนเป้าหมาย
iterationnumberจำนวนการวนซ้ำ

Example: Example

yaml
target: fetch_next_page
max_iterations: 10

Example: Example

yaml
target: cleanup_step

Invoke Workflow

flow.invoke

Execute an external workflow file

Parameters:

NameTypeRequiredDefaultDescription
workflow_sourcestringYes-File path to workflow YAML or inline YAML content
workflow_paramsobjectYes-Parameters to pass to the invoked workflow
timeout_secondsnumberNo300Maximum execution time in seconds
output_mappingobjectNo{}Map internal variables to workflow output

Output:

FieldTypeDescription
__event__stringParameters to pass to the invoked workflow
resultanyMaximum execution time in seconds
workflow_idstringEvent for routing (success/error)
execution_time_msnumberWorkflow execution result

Example: Example

yaml
workflow_source: workflows/validate_order.yaml
workflow_params: {"order_id": "${input.order_id}"}
timeout_seconds: 60

Example: Example

yaml
workflow_source: workflows/process_data.yaml
workflow_params: {"data": "${input.data}"}
output_mapping: {"processed": "result.data"}

รวมสาขา

flow.join

รอให้สาขาคู่ขนานเสร็จสิ้น

Parameters:

NameTypeRequiredDefaultDescription
strategyselect (all, any, first)NoallHow to handle multiple inputs
input_countnumberNo2Number of ports
timeoutnumberNo60000Maximum time to wait in milliseconds
cancel_pendingbooleanNoTrueCancel pending branches when using first strategy

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (joined/timeout/error)
joined_dataarrayข้อมูลที่รวม
completed_countintegerจำนวนสาขาที่เสร็จสิ้น
strategystringกลยุทธ์การรวม

Example: Example

yaml
strategy: all
input_count: 2
timeout_ms: 30000

Example: Example

yaml
strategy: first
input_count: 3
cancel_pending: true

วนซ้ำ

flow.loop

ทำซ้ำขั้นตอน N ครั้งโดยใช้การกำหนดเส้นทางพอร์ตเอาต์พุต

Parameters:

NameTypeRequiredDefaultDescription
timesnumberYes1จำนวนครั้งที่ทำซ้ำ
targetstringNo-ขั้นตอนเป้าหมาย (เลิกใช้แล้ว)
stepsarrayNo-ขั้นตอนที่จะดำเนินการสำหรับแต่ละการวนซ้ำ
index_varstringNoindexชื่อตัวแปรสำหรับดัชนีปัจจุบัน

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (iterate/done)
outputsobjectค่าเอาต์พุตตามพอร์ต
iterationnumberการวนซ้ำปัจจุบัน
statusstringสถานะการดำเนินการ
resultsarrayผลลัพธ์ที่รวบรวม
countnumberจำนวนการวนซ้ำทั้งหมด

Example: Example

yaml
times: 3

Example: Example

yaml
times: 5
steps: [{"module": "browser.click", "params": {"selector": ".next"}}]

รวม

flow.merge

รวมอินพุตหลายตัวเป็นเอาต์พุตเดียว

Parameters:

NameTypeRequiredDefaultDescription
strategyselect (first, last, all)NoallHow to merge multiple inputs
input_countnumberNo2Number of ports

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (merged/error)
merged_dataanyข้อมูลที่รวม
input_countintegerจำนวนอินพุต
strategystringกลยุทธ์การรวม

Example: Example

yaml
strategy: all
input_count: 3

Example: Example

yaml
strategy: first
input_count: 2

ขนาน

flow.parallel

ดำเนินการหลายงานพร้อมกันด้วยกลยุทธ์ที่แตกต่างกัน

Parameters:

NameTypeRequiredDefaultDescription
tasksarrayYes-อาร์เรย์ของคำจำกัดความของงานที่จะดำเนินการพร้อมกัน
modestringNoallอาร์เรย์ของคำจำกัดความของงานที่จะดำเนินการพร้อมกัน
timeout_msnumberNo60000Maximum wait time in milliseconds
fail_fastbooleanNoTrueหยุดงานทั้งหมดเมื่อเกิดความล้มเหลวครั้งแรก (เฉพาะเมื่อ mode=all)
concurrency_limitnumberNo0หยุดงานทั้งหมดเมื่อเกิดความล้มเหลวครั้งแรก (เฉพาะเมื่อ mode=all)

Output:

FieldTypeDescription
__event__stringจำนวนงานพร้อมกันสูงสุด (0 สำหรับไม่จำกัด)
resultsarrayเหตุการณ์สำหรับการกำหนดเส้นทาง (เสร็จสิ้น/บางส่วน/ข้อผิดพลาด)
completed_countnumberเหตุการณ์สำหรับการกำหนดเส้นทาง (เสร็จสิ้น/บางส่วน/ข้อผิดพลาด)
failed_countnumberผลลัพธ์จากทุกงาน
total_countnumberจำนวนงานที่เสร็จสมบูรณ์สำเร็จ
modestringจำนวนงานที่ล้มเหลว
duration_msnumberจำนวนงานทั้งหมด

Example: Example

yaml
tasks: [{"module": "http.get", "params": {"url": "https://api1.example.com"}}, {"module": "http.get", "params": {"url": "https://api2.example.com"}}]
mode: all
timeout_ms: 30000

Example: Example

yaml
tasks: [{"module": "http.get", "params": {"url": "https://mirror1.example.com"}}, {"module": "http.get", "params": {"url": "https://mirror2.example.com"}}]
mode: race

Example: Example

yaml
tasks: [{"module": "http.get", "params": {"url": "https://api1.example.com"}}, {"module": "http.get", "params": {"url": "https://might-fail.example.com"}}]
mode: settle

จำกัดอัตรา

flow.rate_limit

จำกัดอัตราการทำงานโดยใช้ token bucket หรือ sliding window

Parameters:

NameTypeRequiredDefaultDescription
max_requestsnumberYes-จำนวนคำขอสูงสุดที่อนุญาตต่อหน้าต่าง
window_msnumberNo60000หน้าต่างเวลาในหน่วยมิลลิวินาที
strategystringNotoken_bucketกลยุทธ์การจำกัดอัตรา (token_bucket หรือ sliding_window)
queue_overflowstringNowaitพฤติกรรมเมื่อคิวเต็ม (ทิ้งหรือเกิดข้อผิดพลาด)

Output:

FieldTypeDescription
__event__stringเหตุการณ์สำหรับการกำหนดเส้นทาง (อนุญาต/จำกัด)
tokens_remainingnumberโทเค็นที่เหลือใน bucket
window_reset_msnumberมิลลิวินาทีก่อนที่หน้าต่างจะรีเซ็ต
requests_in_windownumberจำนวนคำขอในหน้าต่างปัจจุบัน
wait_msnumberมิลลิวินาทีที่ต้องรอก่อนคำขอถัดไปที่อนุญาต

Example: Example

yaml
max_requests: 100
window_ms: 60000
strategy: token_bucket

Example: Example

yaml
max_requests: 10
window_ms: 1000
strategy: fixed_window
queue_overflow: error

Example: Example

yaml
max_requests: 50
window_ms: 30000
strategy: sliding_window
queue_overflow: wait

ลองใหม่

flow.retry

ลองทำงานที่ล้มเหลวใหม่ด้วยการตั้งค่าการถอยกลับ

Parameters:

NameTypeRequiredDefaultDescription
max_retriesnumberYes3จำนวนครั้งสูงสุดในการลองใหม่
initial_delay_msnumberNo1000ความล่าช้าเริ่มต้นก่อนลองใหม่ครั้งแรกในมิลลิวินาที
backoff_multipliernumberNo2.0ตัวคูณสำหรับการถอยกลับแบบทวีคูณ
max_delay_msnumberNo30000ความล่าช้าสูงสุดระหว่างการลองใหม่ในมิลลิวินาที
retry_on_errorsarrayNo[]ประเภทข้อผิดพลาดที่ต้องลองใหม่ (ว่างหมายถึงลองใหม่ทั้งหมด)

Output:

FieldTypeDescription
__event__stringเหตุการณ์สำหรับการกำหนดเส้นทาง (ลองใหม่/สำเร็จ/ล้มเหลว)
attemptnumberหมายเลขความพยายามปัจจุบัน
max_retriesnumberจำนวนครั้งสูงสุดที่กำหนดไว้สำหรับการลองใหม่
delay_msnumberความล่าช้าก่อนลองใหม่ครั้งถัดไปในมิลลิวินาที
total_elapsed_msnumberเวลาที่ผ่านไปทั้งหมดในมิลลิวินาที
last_errorobjectข้อความข้อผิดพลาดล่าสุด

Example: Example

yaml
max_retries: 3

Example: Example

yaml
max_retries: 10
initial_delay_ms: 500
backoff_multiplier: 1.5
max_delay_ms: 10000

Example: Example

yaml
max_retries: 5
initial_delay_ms: 2000
retry_on_errors: ["TIMEOUT", "RATE_LIMIT", "429", "503"]

เริ่มต้น

flow.start

โหนดเริ่มต้นเวิร์กโฟลว์

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (start)
started_atstringเวลาเริ่มต้น
workflow_idstringรหัสเวิร์กโฟลว์

Example: Example

yaml

ซับโฟลว์

flow.subflow

อ้างอิงและดำเนินการเวิร์กโฟลว์ภายนอก

Parameters:

NameTypeRequiredDefaultDescription
workflow_refstringYes-Text content to process
execution_modeselect (inline, spawn, async)NoinlineSelect an option
input_mappingobjectYes-Data object to process
output_mappingobjectNo{}Map internal variables to workflow output
timeoutnumberNo300000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (success/error)
resultanyผลลัพธ์การดำเนินการ
execution_idstringรหัสการดำเนินการ
workflow_refstringการอ้างอิงเวิร์กโฟลว์

Example: Example

yaml
workflow_ref: workflows/validate_order
execution_mode: inline
input_mapping: {"order_data": "${input.order}"}
output_mapping: {"validation_result": "result"}

Example: Example

yaml
workflow_ref: workflows/send_notifications
execution_mode: spawn

สวิตช์

flow.switch

แยกสาขาหลายทางตามการจับคู่ค่า

Parameters:

NameTypeRequiredDefaultDescription
expressionstringYes-Value to match against cases (supports variable reference)
casesarrayYes[{'id': 'case_1', 'value': 'case1', 'label': 'Case 1'}]List of case definitions

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (case:value หรือ default)
outputsobjectค่าเอาต์พุตตามพอร์ต
matched_casestringกรณีที่ตรงกัน
valueanyค่าที่ตรงกัน

Example: Example

yaml
expression: ${api_response.status}
cases: [{"id": "case-1", "value": "success", "label": "Success"}, {"id": "case-2", "value": "pending", "label": "Pending"}, {"id": "case-3", "value": "error", "label": "Error"}]

Example: Example

yaml
expression: ${input.type}
cases: [{"id": "img", "value": "image", "label": "Image"}, {"id": "vid", "value": "video", "label": "Video"}, {"id": "txt", "value": "text", "label": "Text"}]

ควบคุมอัตรา

flow.throttle

ควบคุมอัตราการทำงานด้วยช่วงเวลาขั้นต่ำ

Parameters:

NameTypeRequiredDefaultDescription
interval_msnumberYes-เวลาขั้นต่ำระหว่างการดำเนินการในมิลลิวินาที
leadingbooleanNoTrueดำเนินการในขอบนำ (การเรียกครั้งแรกผ่านทันที)

Output:

FieldTypeDescription
__event__stringเหตุการณ์สำหรับการกำหนดเส้นทาง (ดำเนินการ/ควบคุม)
last_execution_msnumberเวลาที่ดำเนินการครั้งล่าสุดที่อนุญาต
calls_throttlednumberจำนวนการเรียกที่ถูกควบคุมตั้งแต่การดำเนินการครั้งล่าสุด
time_since_last_msnumberเวลาที่ผ่านไปตั้งแต่การดำเนินการครั้งล่าสุดในมิลลิวินาที
remaining_msnumberมิลลิวินาทีที่เหลือจนกว่าจะอนุญาตให้ดำเนินการครั้งถัดไป

Example: Example

yaml
interval_ms: 1000

Example: Example

yaml
interval_ms: 200
leading: true

Example: Example

yaml
interval_ms: 5000
leading: false

ทริกเกอร์

flow.trigger

จุดเริ่มต้นเวิร์กโฟลว์ - แบบแมนนวล, webhook, กำหนดเวลา หรือเหตุการณ์

Parameters:

NameTypeRequiredDefaultDescription
trigger_typeselect (manual, webhook, schedule, event, mcp, polling)NomanualType of trigger event
webhook_pathstringNo-URL path for webhook trigger
schedulestringNo-Cron expression for scheduled trigger
event_namestringNo-Event name to listen for
tool_namestringNo-MCP tool name exposed to AI agents
tool_descriptionstringNo-Description shown to AI agents for this tool
poll_urlstringNo-API endpoint to poll for changes
poll_intervalnumberNo300How often to check for changes (minimum 60 seconds)
poll_methodselect (GET, POST)NoGETHTTP method for polling request
poll_headersobjectNo{}Custom headers for polling request (e.g. API keys)
poll_bodyobjectNo{}Request body for POST polling
dedup_keystringNo-JSON path to extract a unique value for deduplication
configobjectNo-Custom trigger config (for composites: LINE BOT, Telegram, Slack, etc.)
descriptionstringNo-Optional description text

Output:

FieldTypeDescription
__event__stringเหตุการณ์การกำหนดเส้นทาง (triggered/error)
trigger_dataobjectข้อมูลทริกเกอร์
trigger_typestringประเภททริกเกอร์
triggered_atstringเวลาที่ทริกเกอร์

Example: Example

yaml
trigger_type: manual

Example: Example

yaml
trigger_type: webhook
webhook_path: /api/webhooks/order-created

Example: Example

yaml
trigger_type: schedule
schedule: 0 * * * *

Example: Example

yaml
trigger_type: mcp
tool_name: send-report
tool_description: Send a weekly summary report

Example: Example

yaml
trigger_type: polling
poll_url: https://api.example.com/items
poll_interval: 300
dedup_key: $.data[0].id

Released under the Apache 2.0 License.