{
  "name": "Solace Hermes — Clerk to AI Agent Workflow",
  "version": "15.4",
  "purpose": "Best-practice Zapier template untuk Clerk auth events, AI follow-up, Solace audit trail, CrewAI task, dan notification.",
  "trigger": {
    "app": "Clerk",
    "event": "User Created / User Updated / Session Created"
  },
  "actions": [
    {
      "step": 1,
      "app": "Formatter by Zapier",
      "event": "Normalize user payload",
      "fields": [
        "id",
        "email",
        "first_name",
        "last_name",
        "username",
        "image_url",
        "created_at"
      ]
    },
    {
      "step": 2,
      "app": "Webhooks by Zapier",
      "event": "POST Clerk event to Hermes",
      "method": "POST",
      "url": "https://certve-webhook.certveis.workers.dev/webhook/zapier",
      "headers": {
        "Authorization": "Bearer <TOKEN>",
        "Content-Type": "application/json"
      },
      "body": {
        "action": "clerk_event",
        "event_type": "{{trigger.event}}",
        "email": "{{user.email}}",
        "user": {
          "id": "{{user.id}}",
          "name": "{{user.first_name}} {{user.last_name}}",
          "username": "{{user.username}}",
          "image": "{{user.image_url}}"
        }
      }
    },
    {
      "step": 3,
      "app": "Webhooks by Zapier",
      "event": "Optional AI welcome / profile enrichment",
      "method": "POST",
      "url": "https://certve-webhook.certveis.workers.dev/webhook/zapier",
      "headers": {
        "Authorization": "Bearer <TOKEN>",
        "Content-Type": "application/json"
      },
      "body": {
        "action": "chat",
        "model": "llama-3.1-8b-instant",
        "prompt": "Create a concise Indonesian welcome message for {{user.email}} using Solace Hermes features."
      }
    },
    {
      "step": 4,
      "app": "Webhooks by Zapier",
      "event": "Optional CrewAI task",
      "method": "POST",
      "url": "https://certve-webhook.certveis.workers.dev/webhook/zapier",
      "headers": {
        "Authorization": "Bearer <TOKEN>",
        "Content-Type": "application/json"
      },
      "body": {
        "action": "crew",
        "topic": "Onboard new user {{user.email}} to Solace Hermes",
        "model": "llama-3.3-70b-versatile"
      }
    },
    {
      "step": 5,
      "app": "Notion / Gmail / Slack / Telegram",
      "event": "Create record or notify owner",
      "note": "Use Zapier connected apps, or call action=notify to Hermes."
    }
  ],
  "endpoints": {
    "template": "https://certve-webhook.certveis.workers.dev/zapier/template",
    "webhook": "https://certve-webhook.certveis.workers.dev/webhook/zapier",
    "chat": "https://certve-webhook.certveis.workers.dev/chat",
    "crew": "https://certve-webhook.certveis.workers.dev/crew",
    "integrations": "https://certve-webhook.certveis.workers.dev/integrations"
  },
  "security": [
    "Store TOKEN in Zapier private field, never inside public pages",
    "Use HTTPS only",
    "Rotate token after testing",
    "Worker credentials remain in Cloudflare Secrets"
  ]
}