{ "kind": "open-flow-workflow", "version": 1, "name": "Create Recurring Airtable Tasks from Templates", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_f5b843d57160b421": { "name": "Watch the automation view", "kind": "poll", "config": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_AUTOMATION_TABLE" }, "view": { "kind": "value", "value": "YOUR_VIEW_ID" }, "triggerField": { "kind": "value", "value": "updated_at" }, "fields": { "kind": "value", "value": [] }, "formula": { "kind": "value", "value": "" }, "maxRecordsPerPoll": { "kind": "value", "value": 200 } }, "definition": { "configInputs": [ { "jsonSchema": { "type": "string", "pattern": "^app[A-Za-z0-9]{14}$" }, "nullable": false, "handle": "baseId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "formula", "value": "" }, { "jsonSchema": { "type": "string", "minLength": 1, "maxLength": 255 }, "nullable": false, "handle": "tableIdOrName" }, { "jsonSchema": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^[^}]*$" }, "nullable": false, "handle": "triggerField" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "view", "value": "" }, { "collapsed": true, "group": "Advanced settings" }, { "jsonSchema": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "nullable": false, "handle": "fields", "value": [] }, { "jsonSchema": { "type": "integer", "minimum": 1, "maximum": 1000 }, "nullable": false, "handle": "maxRecordsPerPoll", "value": 200 } ], "definitionVersion": 2, "description": "Polls an Airtable table and triggers when a record is created or updated, ordered by a time field.", "displayName": "Record Created or Updated", "key": "airtable.on_record_changed", "name": "on_record_changed", "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "baseId": { "type": "string" }, "createdTime": { "type": "string" }, "fields": { "type": "object" }, "recordId": { "type": "string" }, "tableIdOrName": { "type": "string" }, "triggerField": { "type": "string" }, "triggerFieldValue": { "type": "string" } }, "additionalProperties": false, "required": [ "baseId", "tableIdOrName", "recordId", "createdTime", "triggerField", "triggerFieldValue", "fields" ] } }, "nullable": false, "handle": "events" } ], "provider": "airtable", "type": "poll" }, "pollTimes": [ { "type": "cron", "expression": "* * * * *", "timezone": "UTC" } ] }, "n_dbfce66e24651d58": { "inputs": { "events": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f5b843d57160b421", "output": "events" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dbfce66e24651d58", "output": "state" } ] } }, "name": "Select the next automation", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "events" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "more" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "count" } ], "name": "Select the next automation", "moduleId": "n_bd55fa7f38194926", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_b2e3cfe20951caf4": { "inputs": {}, "name": "More automations?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "more", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_dbfce66e24651d58", "output": "more" } }, "operator": "==", "right": { "kind": "value", "value": true } } ] } ] } ] }, "n_93aa1eae2248114a": { "inputs": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_AUTOMATION_TABLE" }, "recordId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dbfce66e24651d58", "output": "id" } ] } }, "name": "Read automation", "kind": "task", "task": { "inputs": [ { "description": "Base ID in the format appXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Base ID in the format appXXXXXXXXXXXXXX." }, "nullable": false, "handle": "baseId" }, { "description": "Table ID or table name accepted by the Airtable path parameter.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Table ID or table name accepted by the Airtable path parameter." }, "nullable": false, "handle": "tableIdOrName" }, { "description": "Record ID in the format recXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Record ID in the format recXXXXXXXXXXXXXX." }, "nullable": false, "handle": "recordId" }, { "description": "Cell format accepted by Airtable for read operations.", "jsonSchema": { "type": "string", "enum": [ "json", "string" ], "description": "Cell format accepted by Airtable for read operations." }, "nullable": true, "handle": "cellFormat", "value": null }, { "description": "Timezone string sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Timezone string sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "timeZone", "value": null }, { "description": "User locale sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "User locale sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "userLocale", "value": null }, { "description": "Whether Airtable should return field IDs instead of field names in record objects.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return field IDs instead of field names in record objects." }, "nullable": true, "handle": "returnFieldsByFieldId", "value": null }, { "description": "Whether Airtable should return date dependency metadata for linked record fields.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return date dependency metadata for linked record fields." }, "nullable": true, "handle": "includeDateDependencyMetadata", "value": null } ], "outputs": [ { "description": "Record returned by Airtable.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "record" } ], "name": "Read automation", "executor": { "kind": "connector", "action": "airtable.get_record" } } }, "n_320abb87ad7a8ac2": { "inputs": { "record": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_93aa1eae2248114a", "output": "record" } ] } }, "name": "Read linked record IDs", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "record" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "templateId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "assigneeId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "clientId" } ], "name": "Read linked record IDs", "moduleId": "n_bfe983233046755e", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_667b6bba7833fe73": { "inputs": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_TEMPLATE_TABLE" }, "recordId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_320abb87ad7a8ac2", "output": "templateId" } ] } }, "name": "Read task template", "kind": "task", "task": { "inputs": [ { "description": "Base ID in the format appXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Base ID in the format appXXXXXXXXXXXXXX." }, "nullable": false, "handle": "baseId" }, { "description": "Table ID or table name accepted by the Airtable path parameter.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Table ID or table name accepted by the Airtable path parameter." }, "nullable": false, "handle": "tableIdOrName" }, { "description": "Record ID in the format recXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Record ID in the format recXXXXXXXXXXXXXX." }, "nullable": false, "handle": "recordId" }, { "description": "Cell format accepted by Airtable for read operations.", "jsonSchema": { "type": "string", "enum": [ "json", "string" ], "description": "Cell format accepted by Airtable for read operations." }, "nullable": true, "handle": "cellFormat", "value": null }, { "description": "Timezone string sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Timezone string sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "timeZone", "value": null }, { "description": "User locale sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "User locale sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "userLocale", "value": null }, { "description": "Whether Airtable should return field IDs instead of field names in record objects.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return field IDs instead of field names in record objects." }, "nullable": true, "handle": "returnFieldsByFieldId", "value": null }, { "description": "Whether Airtable should return date dependency metadata for linked record fields.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return date dependency metadata for linked record fields." }, "nullable": true, "handle": "includeDateDependencyMetadata", "value": null } ], "outputs": [ { "description": "Record returned by Airtable.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "record" } ], "name": "Read task template", "executor": { "kind": "connector", "action": "airtable.get_record" } } }, "n_f2a52240dec201d8": { "inputs": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_TEAM_TABLE" }, "recordId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_320abb87ad7a8ac2", "output": "assigneeId" } ] } }, "name": "Read assignee", "kind": "task", "task": { "inputs": [ { "description": "Base ID in the format appXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Base ID in the format appXXXXXXXXXXXXXX." }, "nullable": false, "handle": "baseId" }, { "description": "Table ID or table name accepted by the Airtable path parameter.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Table ID or table name accepted by the Airtable path parameter." }, "nullable": false, "handle": "tableIdOrName" }, { "description": "Record ID in the format recXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Record ID in the format recXXXXXXXXXXXXXX." }, "nullable": false, "handle": "recordId" }, { "description": "Cell format accepted by Airtable for read operations.", "jsonSchema": { "type": "string", "enum": [ "json", "string" ], "description": "Cell format accepted by Airtable for read operations." }, "nullable": true, "handle": "cellFormat", "value": null }, { "description": "Timezone string sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Timezone string sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "timeZone", "value": null }, { "description": "User locale sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "User locale sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "userLocale", "value": null }, { "description": "Whether Airtable should return field IDs instead of field names in record objects.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return field IDs instead of field names in record objects." }, "nullable": true, "handle": "returnFieldsByFieldId", "value": null }, { "description": "Whether Airtable should return date dependency metadata for linked record fields.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return date dependency metadata for linked record fields." }, "nullable": true, "handle": "includeDateDependencyMetadata", "value": null } ], "outputs": [ { "description": "Record returned by Airtable.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "record" } ], "name": "Read assignee", "executor": { "kind": "connector", "action": "airtable.get_record" } } }, "n_12b46d25e17e96bf": { "inputs": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_CLIENT_TABLE" }, "recordId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_320abb87ad7a8ac2", "output": "clientId" } ] } }, "name": "Read client", "kind": "task", "task": { "inputs": [ { "description": "Base ID in the format appXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Base ID in the format appXXXXXXXXXXXXXX." }, "nullable": false, "handle": "baseId" }, { "description": "Table ID or table name accepted by the Airtable path parameter.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Table ID or table name accepted by the Airtable path parameter." }, "nullable": false, "handle": "tableIdOrName" }, { "description": "Record ID in the format recXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Record ID in the format recXXXXXXXXXXXXXX." }, "nullable": false, "handle": "recordId" }, { "description": "Cell format accepted by Airtable for read operations.", "jsonSchema": { "type": "string", "enum": [ "json", "string" ], "description": "Cell format accepted by Airtable for read operations." }, "nullable": true, "handle": "cellFormat", "value": null }, { "description": "Timezone string sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Timezone string sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "timeZone", "value": null }, { "description": "User locale sent to Airtable when cellFormat is string.", "jsonSchema": { "type": "string", "minLength": 1, "description": "User locale sent to Airtable when cellFormat is string." }, "nullable": true, "handle": "userLocale", "value": null }, { "description": "Whether Airtable should return field IDs instead of field names in record objects.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return field IDs instead of field names in record objects." }, "nullable": true, "handle": "returnFieldsByFieldId", "value": null }, { "description": "Whether Airtable should return date dependency metadata for linked record fields.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return date dependency metadata for linked record fields." }, "nullable": true, "handle": "includeDateDependencyMetadata", "value": null } ], "outputs": [ { "description": "Record returned by Airtable.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "record" } ], "name": "Read client", "executor": { "kind": "connector", "action": "airtable.get_record" } } }, "n_96fc2430f71da35e": { "inputs": { "automation": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_93aa1eae2248114a", "output": "record" } ] }, "template": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_667b6bba7833fe73", "output": "record" } ] }, "assignee": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f2a52240dec201d8", "output": "record" } ] }, "client": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_12b46d25e17e96bf", "output": "record" } ] } }, "name": "Prepare task and dates", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "automation" }, { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "template" }, { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "assignee" }, { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Record returned by Airtable." }, "nullable": false, "handle": "client" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Field values for the new Airtable record." } }, "required": [ "fields" ], "additionalProperties": false, "description": "Record payload used when creating Airtable records." }, "minItems": 1, "maxItems": 10, "description": "Records to create in the Airtable table." }, "nullable": false, "handle": "create" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "Record ID in the format recXXXXXXXXXXXXXX." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Field values to write into the existing Airtable record." } }, "required": [ "id", "fields" ], "additionalProperties": false, "description": "Record payload used when updating Airtable records." }, "minItems": 1, "maxItems": 10, "description": "Records to update in the Airtable table." }, "nullable": false, "handle": "update" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "title" } ], "name": "Prepare task and dates", "moduleId": "n_e42e5c7a318743c9", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_fa468fddbc0b662e": { "inputs": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_TASK_TABLE" }, "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_96fc2430f71da35e", "output": "create" } ] }, "typecast": { "kind": "value", "value": false } }, "name": "Create the task", "kind": "task", "task": { "inputs": [ { "description": "Base ID in the format appXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Base ID in the format appXXXXXXXXXXXXXX." }, "nullable": false, "handle": "baseId" }, { "description": "Table ID or table name accepted by the Airtable path parameter.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Table ID or table name accepted by the Airtable path parameter." }, "nullable": false, "handle": "tableIdOrName" }, { "description": "Records to create in the Airtable table.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Field values for the new Airtable record." } }, "required": [ "fields" ], "additionalProperties": false, "description": "Record payload used when creating Airtable records." }, "minItems": 1, "maxItems": 10, "description": "Records to create in the Airtable table." }, "nullable": false, "handle": "records" }, { "description": "Whether Airtable should coerce incoming values to compatible field types.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should coerce incoming values to compatible field types." }, "nullable": true, "handle": "typecast", "value": null }, { "description": "Whether Airtable should return field IDs instead of field names in record objects.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return field IDs instead of field names in record objects." }, "nullable": true, "handle": "returnFieldsByFieldId", "value": null } ], "outputs": [ { "description": "Records created by Airtable.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Airtable record." }, "description": "Records created by Airtable." }, "nullable": false, "handle": "records" } ], "name": "Create the task", "executor": { "kind": "connector", "action": "airtable.create_records" } } }, "n_f4ff59a4f0622986": { "inputs": { "baseId": { "kind": "value", "value": "app00000000000000" }, "tableIdOrName": { "kind": "value", "value": "YOUR_AUTOMATION_TABLE" }, "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_96fc2430f71da35e", "output": "update" } ] }, "typecast": { "kind": "value", "value": false } }, "name": "Update the automation", "kind": "task", "task": { "inputs": [ { "description": "Base ID in the format appXXXXXXXXXXXXXX.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Base ID in the format appXXXXXXXXXXXXXX." }, "nullable": false, "handle": "baseId" }, { "description": "Table ID or table name accepted by the Airtable path parameter.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Table ID or table name accepted by the Airtable path parameter." }, "nullable": false, "handle": "tableIdOrName" }, { "description": "Records to update in the Airtable table.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "Record ID in the format recXXXXXXXXXXXXXX." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Field values to write into the existing Airtable record." } }, "required": [ "id", "fields" ], "additionalProperties": false, "description": "Record payload used when updating Airtable records." }, "minItems": 1, "maxItems": 10, "description": "Records to update in the Airtable table." }, "nullable": false, "handle": "records" }, { "description": "Whether Airtable should coerce incoming values to compatible field types.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should coerce incoming values to compatible field types." }, "nullable": true, "handle": "typecast", "value": null }, { "description": "Whether Airtable should return field IDs instead of field names in record objects.", "jsonSchema": { "type": "boolean", "description": "Whether Airtable should return field IDs instead of field names in record objects." }, "nullable": true, "handle": "returnFieldsByFieldId", "value": null } ], "outputs": [ { "description": "Records returned by Airtable after update.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Airtable record." }, "description": "Records returned by Airtable after update." }, "nullable": false, "handle": "records" } ], "name": "Update the automation", "executor": { "kind": "connector", "action": "airtable.update_records" } } }, "n_494b538fa06569d6": { "inputs": { "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_fa468fddbc0b662e", "output": "records" } ] }, "expectedId": { "kind": "value", "value": null } }, "name": "Confirm task creation", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Airtable record." }, "description": "Records created by Airtable." }, "nullable": false, "handle": "records" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": true, "handle": "expectedId" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" } ], "name": "Confirm task creation", "moduleId": "n_ea5e0f065acb35ab", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_9fe295fa283d3fb5": { "inputs": { "records": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f4ff59a4f0622986", "output": "records" } ] }, "expectedId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dbfce66e24651d58", "output": "id" } ] } }, "name": "Confirm automation update", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Record ID." }, "createdTime": { "type": "string", "description": "Record creation timestamp returned by Airtable." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Record fields keyed by field name or field ID." }, "commentCount": { "type": "integer", "description": "Comment count returned by Airtable when enabled on the endpoint." } }, "required": [ "id", "fields" ], "additionalProperties": true, "description": "Airtable record." }, "description": "Records returned by Airtable after update." }, "nullable": false, "handle": "records" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": true, "handle": "expectedId" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "id" } ], "name": "Confirm automation update", "moduleId": "n_79d7e1842e5c419e", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_da07e7d480233b0c": { "name": "Completed automations", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "count" } ], "outputMappings": { "count": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dbfce66e24651d58", "output": "count" } ] } } } }, "edges": [ { "source": "n_f5b843d57160b421", "target": "n_dbfce66e24651d58" }, { "source": "n_dbfce66e24651d58", "target": "n_b2e3cfe20951caf4" }, { "source": "n_b2e3cfe20951caf4", "target": "n_93aa1eae2248114a", "sourceHandle": "more" }, { "source": "n_93aa1eae2248114a", "target": "n_320abb87ad7a8ac2" }, { "source": "n_320abb87ad7a8ac2", "target": "n_667b6bba7833fe73" }, { "source": "n_667b6bba7833fe73", "target": "n_f2a52240dec201d8" }, { "source": "n_f2a52240dec201d8", "target": "n_12b46d25e17e96bf" }, { "source": "n_12b46d25e17e96bf", "target": "n_96fc2430f71da35e" }, { "source": "n_96fc2430f71da35e", "target": "n_fa468fddbc0b662e" }, { "source": "n_fa468fddbc0b662e", "target": "n_494b538fa06569d6" }, { "source": "n_494b538fa06569d6", "target": "n_f4ff59a4f0622986" }, { "source": "n_f4ff59a4f0622986", "target": "n_9fe295fa283d3fb5" }, { "source": "n_9fe295fa283d3fb5", "target": "n_dbfce66e24651d58" }, { "source": "n_b2e3cfe20951caf4", "target": "n_da07e7d480233b0c", "sourceHandle": "otherwise" } ] } }, "modules": { "n_bd55fa7f38194926": { "name": "Select the next automation", "imports": [], "source": "export default function next({events,previousState}) {\n if (!Array.isArray(events)) throw Error('Invalid events');\n const index=previousState?.index??0;\n if (!Number.isInteger(index)||index<0||index>events.length) throw Error('Invalid event index');\n if (index===events.length) return {state:{index},more:false,id:'unused',count:index};\n const id=events[index]?.recordId;\n if(typeof id!=='string'||!id) throw Error('Missing automation record ID');\n return {state:{index:index+1},more:true,id,count:index};\n}\n" }, "n_bfe983233046755e": { "name": "Read linked record IDs", "imports": [], "source": "export default function links({record}) {\n const f=record?.fields;\n if(!f||typeof record.id!=='string'||!record.id) throw Error('Invalid automation record');\n function one(name){const a=f[name];if(!Array.isArray(a)||typeof a[0]!=='string'||!a[0])throw Error(`Missing ${name} linked record`);return a[0]}\n return {templateId:one('Template'),assigneeId:one('Assigned Team Member'),clientId:one('Client')};\n}\n" }, "n_e42e5c7a318743c9": { "name": "Prepare task and dates", "imports": [], "source": "export default function prepare({automation,template,assignee,client}) {\n const f=automation?.fields,t=template?.fields;\n for(const r of [automation,template,assignee,client])if(typeof r?.id!=='string'||!r.id||!r.fields)throw Error('Invalid Airtable record');\n for(const [name,record] of [['Template',template],['Assigned Team Member',assignee],['Client',client]])if(f?.[name]?.[0]!==record.id)throw Error('Linked record mismatch');\n if(typeof t?.['Template Name']!=='string'||!t['Template Name'].trim()||typeof t.Description!=='string')throw Error('Missing template name or description');\n const first=f['First Task Created'];if(![true,false,'true','false'].includes(first))throw Error('Invalid first-task flag');\n const base=(first===false||first==='false')?f['Start Date']:f['Last Task Created'];\n if(typeof base!=='string'||!/^\\d{4}-\\d\\d-\\d\\d$/.test(base))throw Error('Invalid kickoff date');\n const num=f['Time Value'],soft=f['Days for Soft Due Date'];if(!Number.isSafeInteger(num)||!Number.isSafeInteger(soft))throw Error('Invalid task day offsets');\n const d=new Date(base+'T00:00:00.000Z');if(!Number.isFinite(d.getTime())||d.toISOString().slice(0,10)!==base)throw Error('Invalid date');\n const add=(date,n)=>new Date(date.getTime()+n*86400000).toISOString().slice(0,10);\n const kickoff=add(d,(first===true||first==='true')?num:0),k=new Date(kickoff+'T00:00:00Z'),hard=add(k,num),today=new Date().toISOString().slice(0,10);\n return {create:[{fields:{Status:'Todo','Task Name':t['Template Name'],'Task Description':t.Description,'Kickoff Date':kickoff,'Soft Due Date':add(k,num-soft),'Hard Due Date':hard,Assignee:[assignee.id],Template:[template.id],Client:[client.id]}}],update:[{id:automation.id,fields:{'First Task Created':'true','Last Task Created':today,'Next Task Creation Date':add(new Date(hard+'T00:00:00Z'),-1)}}],title:t['Template Name']};\n}\n" }, "n_ea5e0f065acb35ab": { "name": "Confirm task creation", "imports": [], "source": "export default function confirm({records,expectedId}) {\n if(!Array.isArray(records)||records.length!==1||typeof records[0]?.id!=='string'||!records[0].id||(expectedId&&records[0].id!==expectedId))throw Error('Airtable did not confirm the expected record');\n return {id:records[0].id};\n}\n" }, "n_79d7e1842e5c419e": { "name": "Confirm automation update", "imports": [], "source": "export default function confirm({records,expectedId}) {\n if(!Array.isArray(records)||records.length!==1||typeof records[0]?.id!=='string'||!records[0].id||(expectedId&&records[0].id!==expectedId))throw Error('Airtable did not confirm the expected record');\n return {id:records[0].id};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }