Dillo Flows
Inbox & messages, template v1

New message → reply draft

Each new message is sorted into one of your categories and a reply is drafted in the right tone for that category. You approve, edit, or reject the draft with a comment.

Starts when: Email received. Produces: Reply draft. Steps: 4
Sample run — illustrative, not a record of a real run
messageId
msg-sample-2
threadId
thr-sample-2
from
reader@sample.example
to
["you@example.com"]
subject
Question about my order
snippet
Hi — when will my order arrive?
receivedAt
2026-11-04T11:00:00Z
labelIds
["INBOX"]
hasAttachments
false
1Sort it into a category2Draft it3A person decides4The result

Sample result: Sorted as: Question. Reply drafted in your voice. Approved by you. Reply draft ready.

What each step does

Step 1 · Sort it into a category

An AI step does this part. Today it runs on a simulated stand-in, labelled simulated on every run, until a real model is wired. This step reads text that arrived from outside — an email, a document, a form. Treat its output as a draft from untrusted input: that is why a person checks what it produces before anything leaves. This step sorts each item into your categories. After it has seen about 15 examples you have checked, it can start sorting the routine ones on its own — staged — coming next.

Message · SubjectMessage · Snippet
Sorting examples: Sign in to see how many checked examples this step has collected in your space.

Step 2 · Draft it

An AI step does this part. Today it runs on a simulated stand-in, labelled simulated on every run, until a real model is wired. This step reads text that arrived from outside — an email, a document, a form. Treat its output as a draft from untrusted input: that is why a person checks what it produces before anything leaves.

Message · SnippetHow your replies should sound

Step 3 · A person decides

The run stops and asks the person named in your settings. The decision window is 72 hours; if it lapses, the run carries on without a decision, and the lapse is on the record. Rejecting always takes a comment.

Reply draft · Draft

Step 4 · The result

This is what the run hands back, written into the run's record where you can read it.

Message · ID

What you'll fill in

These are the only things the template asks of you. Examples teach the shape — they are never values your flow runs on; what you type (or the stated starting value) is what gets used.

FieldWhat to put in itExample
Who approves reply draftsThe role or person who approves, edits, or rejects each draft.Inbox owner
How your replies should soundA line or two on tone the drafts should follow.Warm, short, plain words

Set it up

  1. Fill in the fields below.
  2. Name the connections it needs — by name only.
  3. Look at the trigger preview: what would start a run, counted before anything is armed.
  4. Review the steps, the rules, and every place a person is asked.
  5. Create it — then run it once yourself, and read the run's record.
Creating never arms the trigger. The flow is created switched off: no runs start for things that already match. Arming is a separate tap on the created flow, after you have seen the preview count.

Use this template

The role or person who approves, edits, or rejects each draft.

A line or two on tone the drafts should follow.

Sign in to preview what this trigger would match in your space.

The definition

The whole mechanism, before you take it. Package checksums: sha256:4600203d87f8… · sha256:61aa2fba9ce3… · sha256:fa82d5b47aa9…. A flow made from this template carries this template's name and version in its record, and exports in the standard bundle with that provenance.

Advanced · the three files, as written
{
  "trigger.json": {
    "template": {
      "slug": "new-message-reply-draft",
      "version": 1,
      "name": "New message → reply draft",
      "category": "inbox-messages",
      "outcome": "Each new message is sorted into one of your categories and a reply is drafted in the right tone for that category. You approve, edit, or reject the draft with a comment.",
      "outputName": "Reply draft",
      "fits_when": [
        "email_inbox"
      ],
      "needs": []
    },
    "trigger": {
      "type": "email.message.received",
      "source": "gmail",
      "manifestFields": {
        "messageId": "string!",
        "threadId": "string!",
        "from": "string!",
        "to": "string[]!",
        "subject": "string",
        "snippet": "string",
        "receivedAt": "iso!",
        "labelIds": "string[]!",
        "hasAttachments": "bool!"
      }
    },
    "inputConvention": "envelope",
    "variables": [
      {
        "name": "approverRole",
        "kind": "string",
        "label": "Who approves reply drafts",
        "instruction": "The role or person who approves, edits, or rejects each draft.",
        "example": "Inbox owner",
        "default": "Approver"
      },
      {
        "name": "voiceNotes",
        "kind": "string",
        "label": "How your replies should sound",
        "instruction": "A line or two on tone the drafts should follow.",
        "example": "Warm, short, plain words",
        "default": ""
      }
    ],
    "sample": {
      "input": {
        "messageId": "msg-sample-2",
        "threadId": "thr-sample-2",
        "from": "reader@sample.example",
        "to": [
          "you@example.com"
        ],
        "subject": "Question about my order",
        "snippet": "Hi — when will my order arrive?",
        "receivedAt": "2026-11-04T11:00:00Z",
        "labelIds": [
          "INBOX"
        ],
        "hasAttachments": false
      },
      "output": "Sorted as: Question. Reply drafted in your voice. Approved by you. Reply draft ready."
    }
  },
  "flow.json": {
    "name": "New message → reply draft",
    "inputConvention": "envelope",
    "steps": [
      {
        "type": "ai",
        "task": "classify",
        "untrustedInput": true,
        "classify": {
          "categories": [
            "Question",
            "Request",
            "Complaint",
            "Praise",
            "Other"
          ]
        },
        "text": {
          "segments": [
            {
              "text": "Message subject: "
            },
            {
              "field": {
                "source": "trigger",
                "name": "subject",
                "label": "Message · Subject"
              }
            },
            {
              "text": ". Message: "
            },
            {
              "field": {
                "source": "trigger",
                "name": "snippet",
                "label": "Message · Snippet"
              }
            }
          ]
        }
      },
      {
        "type": "ai",
        "task": "draft",
        "untrustedInput": true,
        "text": {
          "segments": [
            {
              "text": "Draft a reply to: "
            },
            {
              "field": {
                "source": "trigger",
                "name": "snippet",
                "label": "Message · Snippet"
              }
            },
            {
              "text": ". Voice: "
            },
            {
              "field": {
                "source": "variable",
                "name": "voiceNotes",
                "label": "How your replies should sound"
              }
            }
          ]
        }
      },
      {
        "type": "human",
        "kind": "approval",
        "prompt": {
          "segments": [
            {
              "text": "Approve this reply draft? "
            },
            {
              "field": {
                "source": "step",
                "stepIndex": 1,
                "path": [
                  "draft"
                ],
                "label": "Reply draft · Draft"
              }
            }
          ]
        },
        "due": 259200,
        "onExpire": "continue"
      },
      {
        "type": "output",
        "value": {
          "segments": [
            {
              "text": "Reply draft ready for message "
            },
            {
              "field": {
                "source": "trigger",
                "name": "messageId",
                "label": "Message · ID"
              }
            }
          ]
        }
      }
    ]
  },
  "rules.json": {
    "rulesets": [],
    "permissions": {
      "approvals": {
        "approveBeforeSteps": [
          2
        ],
        "rejectRequiresComment": true,
        "dueSeconds": 259200,
        "onExpire": "continue"
      },
      "connections": {
        "required": [],
        "optional": []
      }
    }
  }
}

All templates   See the system: Link Map