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
- Webhook Registration Process:
-
The system successfully registers three webhook subscriptions with the MFO server:
unipile.email.received
→http://localhost:3000/webhook/unipile/email
unipile.email.sent
→http://localhost:3000/webhook/unipile/email
unipile.email.opened
→http://localhost:3000/webhook/unipile/email_events
-
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
- Email Draft Preparation:
-
The
EmailDraftPreparator
processes the email:- Creates a job with the thread details
- Processes the email content
- Publishes a
email.draft.prepared
event when complete
-
Channel Usage: The channels are correctly set up:
unipile.email.received
- For incoming emailsunipile.email.sent
- For outgoing emailsunipile.email.opened
- For email open eventsemail.draft.prepared
- For processed email drafts