{
  "name": "AgentSteps · Inbox Triage",
  "flow": [
    {
      "id": 1,
      "module": "google-email:TriggerNewEmail",
      "version": 2,
      "parameters": {
        "folder": "INBOX",
        "criteria": "UNSEEN",
        "searchType": "simple",
        "markSeen": false,
        "maxResults": 5
      },
      "mapper": {},
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0,
          "name": "Watch unread emails"
        }
      }
    },
    {
      "id": 2,
      "module": "openai-gpt-3:CreateCompletion",
      "version": 1,
      "parameters": {},
      "mapper": {
        "select": "chat",
        "model": "gpt-4o-mini",
        "max_tokens": "800",
        "temperature": "0.7",
        "n_completions": "1",
        "messages": [
          {
            "role": "user",
            "content": "Read this email. Reply with one word only: Urgent, Client, Sales or FYI.\n\n{{1.subject}}\n{{1.text}}"
          }
        ]
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0,
          "name": "AI picks a label"
        }
      }
    },
    {
      "id": 3,
      "module": "google-email:ActionModifyLabelsApi",
      "version": 2,
      "parameters": {},
      "mapper": {
        "messageId": "{{1.messageId}}",
        "addLabelIds": [
          "{{2.result}}"
        ]
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0,
          "name": "Add the label"
        }
      }
    },
    {
      "id": 4,
      "module": "openai-gpt-3:CreateCompletion",
      "version": 1,
      "parameters": {},
      "mapper": {
        "select": "chat",
        "model": "gpt-4o-mini",
        "max_tokens": "800",
        "temperature": "0.7",
        "n_completions": "1",
        "messages": [
          {
            "role": "user",
            "content": "Write a short reply in my voice. Match my examples below. Never promise prices, dates or refunds.\n\n[PASTE YOUR 3 EXAMPLE REPLIES HERE]\n\nEmail to answer:\n{{1.text}}"
          }
        ]
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0,
          "name": "AI drafts a reply"
        }
      }
    },
    {
      "id": 5,
      "module": "google-email:createADraft",
      "version": 4,
      "parameters": {},
      "mapper": {
        "to": [
          "{{1.from.address}}"
        ],
        "subject": "Re: {{1.subject}}",
        "contentType": "text",
        "content": "{{4.result}}"
      },
      "metadata": {
        "designer": {
          "x": 1200,
          "y": 0,
          "name": "Gmail draft (you approve)"
        }
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "slots": null,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    }
  }
}
