Readme

go run cmd/yaml-validator/main.go -workflow templates/workflows_definition.yml -prompt templates/prompts_definition.yml -agents templates/agents_definition.yml -print-vars

go run cmd/yaml-validator/main.go -workflow examples/workflow_unipile_client_server/config/workflow_email_processing.yml -prompt examples/workflow_unipile_client_server/config/prompts.yml -print-vars

  1. Webhook Registration Process:
  2. The system successfully registers three webhook subscriptions with the MFO server:

    1. unipile.email.receivedhttp://localhost:3000/webhook/unipile/email
    2. unipile.email.senthttp://localhost:3000/webhook/unipile/email
    3. unipile.email.openedhttp://localhost:3000/webhook/unipile/email_events
  3. Email Processing Flow: When a new email is received or sent, here's what happens:

a. Email Received: - The webhook handler (email_webhook_handler.go) receives the notification - It processes the event based on EventType: - For email_received: 1. Saves the raw webhook payload to Unipile's store 2. Creates a resource with the webhook payload 3. Publishes a Watermill event unipile.email.received with the payload 4. Triggers the email draft preparator process

b. Email Sent: - Similar flow but with email_sent event type - The webhook handler logs the event and processes notifications

  1. Email Draft Preparation:
  2. The EmailDraftPreparator processes the email:

    1. Creates a job with the thread details
    2. Processes the email content
    3. Publishes a email.draft.prepared event when complete
  3. Channel Usage: The channels are correctly set up:

  4. unipile.email.received - For incoming emails
  5. unipile.email.sent - For outgoing emails
  6. unipile.email.opened - For email open events
  7. email.draft.prepared - For processed email drafts