{
  "name": "Law Firm & Mortgage Intake AI Bot with SSN & PII Vault (reversemask)",
  "version": 1,
  "scenario": {
    "name": "Law Firm & Mortgage Intake AI Bot with SSN & PII Vault",
    "flow": [
      {
        "module": "http",
        "action": "makeRequest",
        "name": "reversemask /mask",
        "parameters": {
          "url": "https://reversemask.onrender.com/mask",
          "method": "POST",
          "headers": [
            { "name": "Content-Type", "value": "application/json" }
          ],
          "body": {
            "text": "{{1.body}}",
            "known_pii": {
              "name": "{{1.contact.name}}",
              "email": "{{1.contact.email}}",
              "phone": "{{1.contact.phone}}"
            }
          }
        }
      },
      {
        "module": "openai",
        "action": "createChatCompletion",
        "name": "LLM Agent",
        "parameters": {
          "model": "gpt-4o-mini",
          "messages": [
            {
              "role": "system",
              "content": "You are a helpful assistant for booking appointments. Use the book_appointment tool when the user provides their details."
            },
            {
              "role": "user",
              "content": "{{2.masked_text}}"
            }
          ],
          "tools": [
            {
              "type": "function",
              "function": {
                "name": "book_appointment",
                "description": "Book an appointment for a lead",
                "parameters": {
                  "type": "object",
                  "properties": {
                    "name": { "type": "string" },
                    "email": { "type": "string" },
                    "phone": { "type": "string" },
                    "preferred_time": { "type": "string" }
                  },
                  "required": ["name", "email"]
                }
              }
            }
          ]
        }
      },
      {
        "module": "http",
        "action": "makeRequest",
        "name": "reversemask /unmask",
        "parameters": {
          "url": "https://reversemask.onrender.com/unmask",
          "method": "POST",
          "headers": [
            { "name": "Content-Type", "value": "application/json" }
          ],
          "body": {
            "payload": "{{3.toolCalls}}",
            "vault_bundle": "{{2.vault_bundle}}"
          }
        }
      },
      {
        "module": "http",
        "action": "makeRequest",
        "name": "GoHighLevel / Calendly / CRM",
        "parameters": {
          "url": "https://your-crm-api.com/book",
          "method": "POST",
          "headers": [
            { "name": "Content-Type", "value": "application/json" }
          ],
          "body": "{{4.unmasked_payload}}"
        }
      }
    ],
    "connections": [
      { "from": "reversemask /mask", "to": "LLM Agent" },
      { "from": "LLM Agent", "to": "reversemask /unmask" },
      { "from": "reversemask /unmask", "to": "GoHighLevel / Calendly / CRM" }
    ]
  }
}