Skip to content

Trigger payload mapping UI and config validation #16

Description

@serge-ivo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions