Summary
Add first-class payload mapping for webhook/manual triggers so users can map incoming fields to task or knowledge fields without editing raw JSON or relying on fixed defaults.
Why
Current actions (create_task, add_knowledge, log_event) use simple conventions like title, description, content, and text. That is enough for MVP webhooks, but real sources vary (lead.name, body.message, document.text, etc.). Users need predictable mapping and validation.
Scope
- Add config schema for trigger action mappings.
- Support mappings for:
create_task: title, description
add_knowledge: title, content, sourceUrl
log_event: message or payload summary
- Add console UI controls in instance Settings -> Triggers.
- Add API validation/sanitization for mapping config.
- Preserve current default behavior when no mapping is configured.
- Include a small payload preview/test flow if feasible.
Acceptance Criteria
- A user can create/edit a webhook trigger and map payload paths to task/knowledge fields.
- Existing triggers without mappings continue to work.
- Invalid mapping paths/config return clear API errors.
- Manual
run can test a payload and show success/failure in trigger events.
- E2E covers creating a mapped trigger in the console.
- Unit tests cover mapping extraction, default fallbacks, and invalid configs.
Summary
Add first-class payload mapping for webhook/manual triggers so users can map incoming fields to task or knowledge fields without editing raw JSON or relying on fixed defaults.
Why
Current actions (
create_task,add_knowledge,log_event) use simple conventions liketitle,description,content, andtext. That is enough for MVP webhooks, but real sources vary (lead.name,body.message,document.text, etc.). Users need predictable mapping and validation.Scope
create_task: title, descriptionadd_knowledge: title, content, sourceUrllog_event: message or payload summaryAcceptance Criteria
runcan test a payload and show success/failure in trigger events.