YAML_RULES.md¶
đŻ Objectif¶
Ce fichier documente les rĂšgles de validation et la structure attendue des fichiers YAML de workflow utilisĂ©s dans la plateforme MFO. Il constitue la source de vĂ©ritĂ© pour lâassistant GPT gĂ©nĂ©rant ces workflows, en complĂ©ment du SYSTEM PROMPT.
â RĂšgles de validation¶
1. workflows[].input_mapping
¶
- Doit référencer uniquement des clés définies dans
schemas[].properties
ou dansTRIGGER.payload.xxx
- Syntaxe obligatoire :
TRIGGER.payload.xxx
2. triggers[]
¶
- Champs obligatoires :
id
(unique)type
â {webhook
,schedule
,manual
}enabled
: booléenconfig
: dépend dutype
target_taskflow
: doit correspondre Ă untaskflow_id
existant- Si
type == webhook
: config
doit contenirhttp_path
ethttp_method
input_mapping
doit suivreTRIGGER.payload.xxx
- Si
type == schedule
: config.cron_expression
est requis
3. taskflows[]
¶
- Champs obligatoires :
taskflow_id
: identifiant uniquedescription
: description concise du but métier de ce taskflowtasks[]
: liste de tĂąches conformes aux rĂšgles ci-dessous
4. taskflows[].tasks[]
¶
Chaque tĂąche doit avoir :
Champ | Obligation | RĂšgle |
---|---|---|
id | â | Unique dans son taskflow |
description | â | Doit dĂ©crire le rĂŽle mĂ©tier ou technique de la tĂąche |
type | â | Doit ĂȘtre dans le set dĂ©fini (voir ci-dessous) |
config.tool_id | â ïž Si type = tool | Requis pour mfo_api_tool_execute |
config.prompt_template_id | â ïž Si type = chat | Requis pour mfo_api_chat_send |
prompt_context | â ïž Si prompt | Doit rĂ©fĂ©rencer uniquement INPUT.xxx ou task_id.tool_call_results.xxx |
arguments | â si present | Chaque clĂ© doit pointer vers INPUT.xxx ou task_id.result.xxx |
5. Types de tùches autorisés (type
)¶
mfo_api_tool_execute
mfo_api_chat_send
mfo_api_resource_get
mfo_api_memory_get
mfo_api_memory_store
6. error_handling.on_error[]
¶
- Type attendu : liste dâobjets avec :
type
:retry_with_prompt
,fail_fast
, etc.max_retries
siretry_with_prompt
append_to_system_prompt
si applicableerror_message
pourfail_fast
7. validation[]
(si LLM)¶
- RĂšgles LLM Ă appliquer Ă la sortie :
type: require_tool_call
tool_name
: nom du tool attenduerror_message
: message en cas dâĂ©chec
8. Consistance entre blocs¶
- Chaque
target_taskflow
référencé dans untrigger
doit exister - Chaque variable
INPUT.xxx
outask_id.result.xxx
utilisĂ©e doit ĂȘtre dĂ©finie en amont - DĂ©pendances implicites entre tĂąches doivent respecter lâordre dâapparition
đŠ Structure type dâun fichier workflow.yml
¶
workflow_name: "ExampleWorkflow"
version: "1.0"
workflows:
- id: "my_workflow"
taskflow_id: "main_taskflow"
description: "short description of the taskflow"
input_mapping:
email_id: "TRIGGER.payload.email_id"
triggers:
- id: "trigger_email"
type: "webhook"
enabled: true
config:
http_path: "/webhook/email"
http_method: "POST"
input_mapping:
email_id: "TRIGGER.payload.email_id"
target_taskflow: "main_taskflow"
schemas:
- name: MyPayload
type: object
properties:
email_id:
type: string
taskflows:
- taskflow_id: "main_taskflow"
description: "short description of the taskflow"
tasks:
- id: "fetch_email"
description: "short description of the task"
type: "mfo_api_tool_execute"
config:
tool_id: "unipile_email_fetch"
arguments:
email_id: "INPUT.email_id"
- id: "analyze_email"
description: "short description of the task"
type: "mfo_api_chat_send"
config:
prompt_template_id: "email_analysis"
prompt_context:
content: "fetch_email.result.content"
error_handling:
on_error:
- type: retry_with_prompt
append_to_system_prompt: "retry analysis"
max_retries: 2
đ Ă valider automatiquement cĂŽtĂ© assistant¶
- Chaque
taskflow_id
référencé doit exister - Les
INPUT.xxx
doivent venir soit duinput_mapping
, soit dâunTRIGGER.payload.xxx
- Les
task_id.result.xxx
doivent rĂ©fĂ©rencer des tĂąches antĂ©rieures dans le mĂȘmetaskflow
- Chaque
task
ettaskflow
doit comporter un champdescription
clair