Ir al contenido

Esquema YAML de Flow

Los flows se definen en archivos YAML con la extensión .ygtc. Esta referencia cubre el esquema completo.

name: string # Required: Flow identifier
version: string # Required: Semantic version
description: string # Optional: Human-readable description
nodes: [] # Required: List of nodes
triggers: [] # Required: List of triggers
variables: {} # Optional: Flow-level variables
config: {} # Optional: Flow configuration
nodes:
- id: string # Required: Unique node identifier
type: string # Required: Node type
config: object # Type-specific configuration
next: string # Optional: Next node ID
on_error: string # Optional: Error handler node ID
output: string # Optional: Output variable name
timeout: number # Optional: Timeout in milliseconds

Envía una respuesta de mensaje.

- id: greet
type: reply
config:
message: string # Message text
buttons: [] # Optional: Action buttons
attachments: [] # Optional: File attachments

Llama a un LLM.

- id: analyze
type: llm
config:
model: string # Model name (e.g., "gpt-4")
prompt: string # User prompt
system_prompt: string # Optional: System message
temperature: number # Optional: 0-2 (default: 1)
max_tokens: number # Optional: Max response tokens
output_format: string # Optional: "text" or "json"
functions: [] # Optional: Function definitions

Renderiza una plantilla Handlebars.

- id: format
type: template
config:
template: string # Inline template
template_file: string # Or: Path to template file
data: object # Optional: Template data

Ejecuta un script Rhai.

- id: calculate
type: script
config:
script: string # Inline script
script_file: string # Or: Path to script file

Ramificación condicional.

- id: route
type: branch
config:
conditions:
- expression: string # Condition expression
next: string # Target node if true
default: string # Default node if no match

Administra el estado de la sesión.

- id: save
type: state
config:
action: string # "get", "set", "delete"
key: string # State key
value: any # Value (for "set")
output: string # Output variable (for "get")

Realiza solicitudes HTTP.

- id: fetch
type: http
config:
method: string # HTTP method
url: string # Request URL
headers: object # Optional: HTTP headers
body: any # Optional: Request body
timeout: number # Optional: Timeout in ms

Emite un evento.

- id: notify
type: event
config:
event_type: string # Event type identifier
payload: object # Event payload

Renderiza una Adaptive Card.

- id: show_card
type: adaptive-card
config:
card: string # Card name (from pack)
card_json: object # Or: Inline card JSON
data: object # Optional: Card data

Enrutamiento por intención.

- id: route
type: fast2flow
config:
config_file: string # Path to fast2flow config
fallback_to_llm: bool # Optional: Use LLM for ambiguous

Invoca un sub-flow.

- id: call_sub
type: flow2flow
config:
target_flow: string # Flow to invoke
pass_context: bool # Optional: Pass current context
input: object # Optional: Input data

Ejecuta una herramienta MCP.

- id: query
type: mcp-tool
config:
tool: string # Tool name
parameters: object # Tool parameters
triggers:
- type: string # Trigger type
target: string # Target node ID
# Type-specific fields

Se activa con mensajes entrantes.

- type: message
pattern: string # Optional: Regex pattern
target: start

Trigger general.

- type: default
target: fallback

Se activa por eventos.

- type: event
event_type: string # Event type to listen for
target: handle_event

Trigger programado.

- type: timer
cron: string # Cron expression
timezone: string # Optional: Timezone
target: scheduled_task

Callback de botón (Telegram).

- type: callback_query
target: handle_button