Receipt from chat → expense sheet
Post a receipt in chat and the amount, merchant, and date are pulled off it and filed as a row in the expense sheet — after you approve the extraction. The chat message stays the source; the row names it.
- messageId
- sl_501
- channelId
- receipts
- userId
- u_ana
- text
- Lunch with the landlord — $86.40 at Harbor Cafe, Nov 9
- postedAt
- 2026-11-09T20:00:00Z
- hasFiles
- true
Sample result: Receipt filed: Harbor Cafe.
What each step does
Step 1 · Pull out the details
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.
Step 2 · 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.
Step 3 · Write it back
The outcome is posted back through the connection you name. The secret stays sealed; the step carries the name only.
Step 4 · Send it onward
Step 5 · The result
This is what the run hands back, written into the run's record where you can read it.
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.
| Field | What to put in it | Example |
|---|---|---|
| Expense sheet | The connection, by name, that can append rows to the expense sheet. | A connection you name — never a key pasted here |
| Who approves | The role or person the approval card is addressed to. | Office manager |
Set it up
- Fill in the fields below.
- Name the connections it needs — by name only.
- Look at the trigger preview: what would start a run, counted before anything is armed.
- Review the steps, the rules, and every place a person is asked.
- Create it — then run it once yourself, and read the run's record.
Use this template
The definition
The whole mechanism, before you take it. Package checksums: sha256:58b759003f0e… · sha256:09d5e1c8097b… · sha256:4af398b1329a…. 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": "receipt-from-chat-to-sheet",
"version": 1,
"name": "Receipt from chat → expense sheet",
"category": "money-expenses",
"outcome": "Post a receipt in chat and the amount, merchant, and date are pulled off it and filed as a row in the expense sheet — after you approve the extraction. The chat message stays the source; the row names it.",
"outputName": "Receipt filing result",
"fits_when": [
"expenses",
"team_chat"
],
"needs": [
"connection:sheet"
]
},
"trigger": {
"type": "slack.message.posted",
"source": "slack",
"manifestFields": {
"messageId": "string!",
"channelId": "string!",
"userId": "string!",
"text": "string!",
"postedAt": "iso!",
"hasFiles": "bool!"
}
},
"inputConvention": "envelope",
"variables": [
{
"name": "sheetConnection",
"kind": "connection",
"label": "Expense sheet",
"instruction": "The connection, by name, that can append rows to the expense sheet."
},
{
"name": "approverRole",
"kind": "string",
"label": "Who approves",
"instruction": "The role or person the approval card is addressed to.",
"example": "Office manager",
"default": "Approver"
}
],
"sample": {
"input": {
"messageId": "sl_501",
"channelId": "receipts",
"userId": "u_ana",
"text": "Lunch with the landlord — $86.40 at Harbor Cafe, Nov 9",
"postedAt": "2026-11-09T20:00:00Z",
"hasFiles": true
},
"output": "Receipt filed: Harbor Cafe."
}
},
"flow.json": {
"name": "Receipt from chat → expense sheet",
"inputConvention": "envelope",
"clefIn": [
{
"ruleset": "receipt-guard",
"ids": [
"message-text-present"
]
}
],
"steps": [
{
"type": "ai",
"task": "extract",
"untrustedInput": true,
"text": {
"segments": [
{
"text": "Extract the merchant, amount in cents, currency, and date from this receipt message: "
},
{
"field": {
"source": "trigger",
"name": "text",
"label": "Message · Text"
}
}
]
}
},
{
"type": "human",
"kind": "approval",
"due": 259200,
"onExpire": "continue",
"prompt": {
"segments": [
{
"text": "File this receipt? "
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"merchant"
],
"label": "Receipt · Merchant"
}
},
{
"text": " — "
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"amountCents"
],
"label": "Receipt · Amount (cents)"
}
},
{
"text": " "
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"currency"
],
"label": "Receipt · Currency"
}
}
]
}
},
{
"type": "http",
"method": "POST",
"connectionFromVariable": "sheetConnection",
"url": "https://sheets.example.com/rows",
"body": {
"segments": [
{
"text": "{\"merchant\": \""
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"merchant"
],
"label": "Receipt · Merchant"
}
},
{
"text": "\", \"amountCents\": "
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"amountCents"
],
"label": "Receipt · Amount (cents)"
}
},
{
"text": ", \"currency\": \""
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"currency"
],
"label": "Receipt · Currency"
}
},
{
"text": "\", \"occurredOn\": \""
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"occurredOn"
],
"label": "Receipt · Date"
}
},
{
"text": "\", \"sourceMessage\": \""
},
{
"field": {
"source": "trigger",
"name": "messageId",
"label": "Message · ID"
}
},
{
"text": "\", \"postedBy\": \""
},
{
"field": {
"source": "trigger",
"name": "userId",
"label": "Message · Author"
}
},
{
"text": "\"}"
}
]
}
},
{
"type": "dispatch",
"channel": "event",
"name": "finance.receipt.filed"
},
{
"type": "output",
"value": {
"segments": [
{
"text": "Receipt filed: "
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"merchant"
],
"label": "Receipt · Merchant"
}
},
{
"text": "."
}
]
}
}
]
},
"rules.json": {
"rulesets": [
{
"name": "receipt-guard",
"version": 1,
"rules": [
{
"id": "message-text-present",
"on": "step.payload.text",
"op": "missing",
"action": "block",
"msg": "A receipt cannot be read from an empty message."
}
]
}
],
"permissions": {
"approvals": {
"approveBeforeSteps": [
1
],
"rejectRequiresComment": true,
"dueSeconds": 259200,
"onExpire": "continue"
},
"connections": {
"required": [
{
"nameFromVariable": "sheetConnection",
"usedBySteps": [
2
]
}
],
"optional": []
}
}
}
}