Files
osmedeus/test/testdata/full-field-workflows/flow-with-decisions.yaml
T
j3ssie f5840272c5 feat: add run cancellation, event enhancements, and performance optimizations
Major features:
- Add run registry for tracking active runs with PID management
- Add API-based run cancellation with process termination
- Add event trigger input vars syntax for multi-variable extraction
- Add filter_functions with utility function support in triggers
- Add event envelope injection for full event context in workflows
- Add write coordinator for batched database operations

API improvements:
- Add logout endpoint and diffs endpoints for assets/vulnerabilities
- Add step-results listing endpoint
- Update schedule model with target, workspace, params fields
- Change run_id to run_uuid across API responses

Performance:
- Add compiled JS program caching for 60-80% faster loop conditions
- Add parallel shard rendering for 20-40% faster workflow startup
- Add memory-mapped I/O for large file line counting
- Add efficient output buffer combining in runners
- Add mtime-based cache invalidation for workflow loader

Other changes:
- Rename trigger field from trigger to triggers in workflow YAML
- Disable pongo2 HTML autoescape for shell command templates
- Update JWT expiration default to 1440 minutes (1 day)
- Change CORS default to reflect-origin for credentials support
- Add source_type field to events (run, eval, api)
- Skip copying core Unix tools to external-binaries
2026-01-24 01:11:33 +08:00

155 lines
3.5 KiB
YAML

# Comprehensive example demonstrating flow with decision routing between modules
kind: flow
name: flow-with-decisions
description: Flow with decision routing between modules based on conditions
tags: example, flow, decisions, comprehensive
params:
- name: target
required: true
- name: scan_depth
default: "standard"
- name: enable_notifications
type: bool
default: true
# Triggers for automated execution
triggers:
- name: manual-trigger
on: manual
enabled: true
- name: scheduled-scan
on: cron
schedule: "0 2 * * *"
enabled: false
input:
type: file
path: "{{BaseDir}}/targets.txt"
modules:
# Initial reconnaissance module
- name: recon
path: test-with-fragment
params:
domain: "{{target}}"
on_success:
- action: log
message: "Recon completed for {{target}}"
- action: export
name: recon_complete
value: true
on_error:
- action: log
message: "Recon failed for {{target}}"
- action: abort
decision:
switch: "{{scan_depth}}"
cases:
"quick":
goto: quick-scan-module
"standard":
goto: standard-scan-module
"deep":
goto: deep-scan-module
default:
goto: standard-scan-module
# Quick scan path
- name: quick-scan-module
path: test-fragment-nested-steps
params:
target: "{{target}}"
depends_on:
- recon
condition: "{{scan_depth}} == 'quick'"
decision:
switch: "{{enable_notifications}}"
cases:
"true":
goto: notify-module
default:
goto: _end
# Standard scan path
- name: standard-scan-module
path: test-fragment-multi-chain
params:
target: "{{target}}"
depends_on:
- recon
condition: "{{scan_depth}} == 'standard'"
on_success:
- action: log
message: "Standard scan completed"
decision:
switch: "{{enable_notifications}}"
cases:
"true":
goto: notify-module
default:
goto: _end
# Deep scan path with additional modules
- name: deep-scan-module
path: test-fragment-with-dependencies
params:
target: "{{target}}"
depends_on:
- recon
condition: "{{scan_depth}} == 'deep'"
on_success:
- action: export
name: deep_scan_done
value: true
decision:
switch: "true"
cases:
"true":
goto: vulnerability-scan
# Additional vulnerability scanning for deep mode
- name: vulnerability-scan
path: test-fragment-nested-steps
params:
target: "{{target}}"
depends_on:
- deep-scan-module
on_success:
- action: log
message: "Vulnerability scan completed"
decision:
switch: "{{enable_notifications}}"
cases:
"true":
goto: notify-module
default:
goto: _end
# Notification module (optional, based on enable_notifications)
- name: notify-module
path: test-with-fragment
params:
domain: "{{target}}"
on_success:
- action: notify
notify: "Scan completed for {{target}} with depth {{scan_depth}}"
on_error:
- action: log
message: "Notification failed but scan was successful"
- action: continue
# Module demonstrating explicit _end routing
- name: cleanup-module
path: test-step-dependencies
params:
target: "{{target}}"
depends_on:
- notify-module
decision:
switch: "true"
cases:
"true":
goto: _end
default:
goto: _end