Document changed → what changed
When a watched document changes, the new version is fetched and a short note says what changed, written for the document's owner.
- documentId
- doc-sample-1
- title
- Sample plan
- revisionId
- rev-sample-2
- editor
- Sample Editor
Sample result: Change note: the launch date moved and two paragraphs were added. Note ready for the owner.
What each step does
Step 1 · Write it back
The outcome is posted back through the connection you name. The secret stays sealed; the step carries the name only.
Step 2 · Read and summarize
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 3 · 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 |
|---|---|---|
| Documents to read from | The connection, by name, that can fetch the document. | A connection you name — never a key pasted here |
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:142b1e93498c… · sha256:3e07b365f528… · sha256:d083942164ab…. 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": "document-changed-what-changed",
"version": 1,
"name": "Document changed → what changed",
"category": "records-files",
"outcome": "When a watched document changes, the new version is fetched and a short note says what changed, written for the document's owner.",
"outputName": "Change note",
"fits_when": [
"shared_docs"
],
"needs": [
"connection:google"
]
},
"trigger": {
"type": "docs.document.edited",
"source": "google",
"manifestFields": {
"documentId": "string!",
"title": "string!",
"revisionId": "string!",
"editor": "string"
}
},
"inputConvention": "envelope",
"variables": [
{
"name": "docsConnection",
"kind": "connection",
"label": "Documents to read from",
"instruction": "The connection, by name, that can fetch the document."
}
],
"sample": {
"input": {
"documentId": "doc-sample-1",
"title": "Sample plan",
"revisionId": "rev-sample-2",
"editor": "Sample Editor"
},
"output": "Change note: the launch date moved and two paragraphs were added. Note ready for the owner."
}
},
"flow.json": {
"name": "Document changed → what changed",
"inputConvention": "envelope",
"steps": [
{
"type": "http",
"method": "GET",
"connectionFromVariable": "docsConnection",
"url": {
"segments": [
{
"text": "https://example.com/documents/"
},
{
"field": {
"source": "trigger",
"name": "documentId",
"label": "Document · ID"
}
}
]
}
},
{
"type": "ai",
"task": "summarize",
"untrustedInput": true,
"text": {
"segments": [
{
"text": "Document "
},
{
"field": {
"source": "trigger",
"name": "title",
"label": "Document · Title"
}
},
{
"text": " changed. New content: "
},
{
"field": {
"source": "step",
"stepIndex": 0,
"path": [
"body"
],
"label": "Document fetch · Body"
}
},
{
"text": ". Write a short note on what changed."
}
]
}
},
{
"type": "output",
"value": {
"segments": [
{
"text": "Change note ready for "
},
{
"field": {
"source": "trigger",
"name": "title",
"label": "Document · Title"
}
}
]
}
}
]
},
"rules.json": {
"rulesets": [],
"permissions": {
"approvals": {
"approveBeforeSteps": [],
"rejectRequiresComment": true,
"dueSeconds": 259200,
"onExpire": "continue"
},
"connections": {
"required": [
{
"nameFromVariable": "docsConnection",
"usedBySteps": [
0
]
}
],
"optional": []
}
}
}
}