{ "kind": "open-flow-workflow", "version": 1, "name": "Calendly Booking to Notion", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_ae02f2244120efa7": { "name": "Receive a new Calendly booking", "kind": "integration", "config": { "scope": { "kind": "value", "value": "user" }, "eventTypes": { "kind": "value", "value": [ "invitee.created" ] } }, "definition": { "configInputs": [ { "jsonSchema": { "type": "string", "enum": [ "user", "organization" ], "title": "Scope" }, "nullable": false, "handle": "scope", "value": "user" }, { "jsonSchema": { "type": "array", "items": { "type": "string", "enum": [ "invitee.created", "invitee.canceled" ] }, "minItems": 1, "uniqueItems": true, "title": "Events" }, "nullable": false, "handle": "eventTypes", "value": [ "invitee.created", "invitee.canceled" ] } ], "definitionVersion": 2, "description": "Receives bookings and cancellations, preserving reschedule links. Requires a Personal Access Token connection.", "displayName": "Booking Created or Canceled", "key": "calendly.on_booking_event", "name": "on_booking_event", "outputs": [ { "jsonSchema": { "type": "string", "enum": [ "invitee.created", "invitee.canceled" ] }, "nullable": false, "handle": "event" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "inviteeUri" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "createdAt" }, { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "body" } ], "provider": "calendly", "type": "integration", "endpoint": { "body": { "allowArray": false, "allowEmpty": false, "formats": [ "json" ] }, "methods": [ "POST" ], "successStatus": 200 } } }, "n_2e2a8ce31ae0038a": { "inputs": { "invitee": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_ae02f2244120efa7", "output": "body" } ] }, "dataSourceId": { "kind": "value", "value": "YOUR_NOTION_DATA_SOURCE_ID" }, "statusOptionId": { "kind": "value", "value": "YOUR_NOTION_STATUS_OPTION_ID" } }, "name": "Prepare Notion page request", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "invitee" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "dataSourceId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "statusOptionId" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "parent" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "properties" } ], "name": "Prepare Notion page request", "moduleId": "n_f2651389ad700e49", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_8ac3f9a77fba6c91": { "inputs": { "parent": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2e2a8ce31ae0038a", "output": "parent" } ] }, "properties": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2e2a8ce31ae0038a", "output": "properties" } ] } }, "name": "Create the booking record", "kind": "task", "task": { "inputs": [ { "description": "The parent page ID.", "jsonSchema": { "type": "string", "description": "The parent page ID." }, "nullable": true, "handle": "parentId", "value": null }, { "description": "The page title.", "jsonSchema": { "type": "string", "description": "The page title." }, "nullable": true, "handle": "title", "value": null }, { "description": "The official Notion parent object payload. Use { page_id: \"...\" } for a child page under an existing page, { data_source_id: \"...\" } for a data source row, or { workspace: true } to create a workspace-level private page when the credential is an OAuth public integration. When parent is provided, do not use the top-level title field; set the title through properties.title instead. Internal integration secrets usually cannot create workspace-level private pages and should use a parent page or data source.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "A Notion parent field value." }, "description": "The official Notion parent object payload. Use { page_id: \"...\" } for a child page under an existing page, { data_source_id: \"...\" } for a data source row, or { workspace: true } to create a workspace-level private page when the credential is an OAuth public integration. When parent is provided, do not use the top-level title field; set the title through properties.title instead. Internal integration secrets usually cannot create workspace-level private pages and should use a parent page or data source." }, "nullable": true, "handle": "parent", "value": null }, { "description": "The page properties.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "A Notion page property value." }, "description": "The page properties." }, "nullable": true, "handle": "properties", "value": null }, { "description": "The child blocks to add.", "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "A Notion block object." }, "description": "The child blocks to add." }, "nullable": true, "handle": "children", "value": null }, { "description": "Enhanced Markdown content to create page content. Mutually exclusive with children. Markdown-only private pages without parent are supported only for OAuth public connections or personal access tokens; internal integration secrets should provide a parent page or data source.", "jsonSchema": { "type": "string", "description": "Enhanced Markdown content to create page content. Mutually exclusive with children. Markdown-only private pages without parent are supported only for OAuth public connections or personal access tokens; internal integration secrets should provide a parent page or data source." }, "nullable": true, "handle": "markdown", "value": null }, { "description": "The data source template payload to apply to the created page.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "A Notion template field value." }, "description": "The data source template payload to apply to the created page." }, "nullable": true, "handle": "template", "value": null }, { "description": "The page icon object.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "A Notion icon field value." }, "description": "The page icon object." }, "nullable": true, "handle": "icon", "value": null }, { "description": "The page cover object.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "A Notion cover field value." }, "description": "The page cover object." }, "nullable": true, "handle": "cover", "value": null } ], "outputs": [ { "description": "The created Notion page object returned by the API.", "jsonSchema": { "type": "object", "properties": { "object": { "const": "page", "description": "The Notion object type." }, "id": { "type": "string", "description": "The page ID." }, "created_time": { "type": "string", "format": "date-time", "description": "The time when the page was created." }, "last_edited_time": { "type": "string", "format": "date-time", "description": "The time when the page was last edited." }, "created_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "last_edited_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "cover": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page cover object, or null when the page has no cover." }, "icon": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page icon object, or null when the page has no icon." }, "parent": { "type": "object", "properties": { "type": { "type": "string", "description": "The parent type, such as workspace, page_id, data_source_id, database_id, or block_id." } }, "additionalProperties": true, "description": "The parent object that contains this Notion object." }, "is_archived": { "type": "boolean", "description": "Whether the page has been archived." }, "in_trash": { "type": "boolean", "description": "Whether the page is in the trash." }, "is_locked": { "type": "boolean", "description": "Whether the page is locked." }, "properties": { "type": "object", "additionalProperties": { "description": "A Notion property value or property schema object." }, "description": "The Notion page, database, or data source properties keyed by property name." }, "url": { "type": "string", "format": "uri", "description": "The canonical Notion URL for the page." }, "public_url": { "type": [ "string", "null" ], "format": "uri", "description": "The public Notion URL if the page is published to the web." } }, "additionalProperties": true, "description": "The created Notion page object returned by the API." }, "nullable": false, "handle": "output" } ], "name": "Create the booking record", "executor": { "kind": "connector", "action": "notion.create_page", "outputMode": "value" } } }, "n_5c7b3e2bbcc89b86": { "inputs": { "page": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8ac3f9a77fba6c91", "output": "output" } ] } }, "name": "Check the created Notion page", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "object": { "const": "page", "description": "The Notion object type." }, "id": { "type": "string", "description": "The page ID." }, "created_time": { "type": "string", "format": "date-time", "description": "The time when the page was created." }, "last_edited_time": { "type": "string", "format": "date-time", "description": "The time when the page was last edited." }, "created_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "last_edited_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "cover": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page cover object, or null when the page has no cover." }, "icon": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page icon object, or null when the page has no icon." }, "parent": { "type": "object", "properties": { "type": { "type": "string", "description": "The parent type, such as workspace, page_id, data_source_id, database_id, or block_id." } }, "additionalProperties": true, "description": "The parent object that contains this Notion object." }, "is_archived": { "type": "boolean", "description": "Whether the page has been archived." }, "in_trash": { "type": "boolean", "description": "Whether the page is in the trash." }, "is_locked": { "type": "boolean", "description": "Whether the page is locked." }, "properties": { "type": "object", "additionalProperties": { "description": "A Notion property value or property schema object." }, "description": "The Notion page, database, or data source properties keyed by property name." }, "url": { "type": "string", "format": "uri", "description": "The canonical Notion URL for the page." }, "public_url": { "type": [ "string", "null" ], "format": "uri", "description": "The public Notion URL if the page is published to the web." } }, "additionalProperties": true, "description": "The created Notion page object returned by the API." }, "nullable": false, "handle": "page" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "object": { "const": "page", "description": "The Notion object type." }, "id": { "type": "string", "description": "The page ID." }, "created_time": { "type": "string", "format": "date-time", "description": "The time when the page was created." }, "last_edited_time": { "type": "string", "format": "date-time", "description": "The time when the page was last edited." }, "created_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "last_edited_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "cover": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page cover object, or null when the page has no cover." }, "icon": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page icon object, or null when the page has no icon." }, "parent": { "type": "object", "properties": { "type": { "type": "string", "description": "The parent type, such as workspace, page_id, data_source_id, database_id, or block_id." } }, "additionalProperties": true, "description": "The parent object that contains this Notion object." }, "is_archived": { "type": "boolean", "description": "Whether the page has been archived." }, "in_trash": { "type": "boolean", "description": "Whether the page is in the trash." }, "is_locked": { "type": "boolean", "description": "Whether the page is locked." }, "properties": { "type": "object", "additionalProperties": { "description": "A Notion property value or property schema object." }, "description": "The Notion page, database, or data source properties keyed by property name." }, "url": { "type": "string", "format": "uri", "description": "The canonical Notion URL for the page." }, "public_url": { "type": [ "string", "null" ], "format": "uri", "description": "The public Notion URL if the page is published to the web." } }, "additionalProperties": true, "description": "The created Notion page object returned by the API." }, "nullable": false, "handle": "page" } ], "name": "Check the created Notion page", "moduleId": "n_ddc5f4a606a35b84", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_b05499651d52353f": { "name": "Created Notion booking page", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "properties": { "object": { "const": "page", "description": "The Notion object type." }, "id": { "type": "string", "description": "The page ID." }, "created_time": { "type": "string", "format": "date-time", "description": "The time when the page was created." }, "last_edited_time": { "type": "string", "format": "date-time", "description": "The time when the page was last edited." }, "created_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "last_edited_by": { "type": "object", "properties": { "object": { "const": "user", "description": "The Notion object type." }, "id": { "type": "string", "description": "The Notion user ID." }, "name": { "type": [ "string", "null" ], "description": "The user's display name, or null when unavailable." }, "avatar_url": { "type": [ "string", "null" ], "description": "The user's avatar URL, or null when unavailable." }, "type": { "type": "string", "enum": [ "person", "bot" ], "description": "The user type returned by Notion." }, "person": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "The person's email address." } }, "additionalProperties": true, "description": "Details about a person user." }, "bot": { "type": "object", "additionalProperties": { "description": "A Notion API field value." }, "description": "Details about a bot user." } }, "additionalProperties": true, "description": "A Notion user reference." }, "cover": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page cover object, or null when the page has no cover." }, "icon": { "type": [ "object", "null" ], "additionalProperties": { "description": "A Notion API field value." }, "description": "The page icon object, or null when the page has no icon." }, "parent": { "type": "object", "properties": { "type": { "type": "string", "description": "The parent type, such as workspace, page_id, data_source_id, database_id, or block_id." } }, "additionalProperties": true, "description": "The parent object that contains this Notion object." }, "is_archived": { "type": "boolean", "description": "Whether the page has been archived." }, "in_trash": { "type": "boolean", "description": "Whether the page is in the trash." }, "is_locked": { "type": "boolean", "description": "Whether the page is locked." }, "properties": { "type": "object", "additionalProperties": { "description": "A Notion property value or property schema object." }, "description": "The Notion page, database, or data source properties keyed by property name." }, "url": { "type": "string", "format": "uri", "description": "The canonical Notion URL for the page." }, "public_url": { "type": [ "string", "null" ], "format": "uri", "description": "The public Notion URL if the page is published to the web." } }, "additionalProperties": true, "description": "The created Notion page object returned by the API." }, "nullable": false, "handle": "page" } ], "outputMappings": { "page": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5c7b3e2bbcc89b86", "output": "page" } ] } } } }, "edges": [ { "source": "n_ae02f2244120efa7", "target": "n_2e2a8ce31ae0038a" }, { "source": "n_2e2a8ce31ae0038a", "target": "n_8ac3f9a77fba6c91" }, { "source": "n_8ac3f9a77fba6c91", "target": "n_5c7b3e2bbcc89b86" }, { "source": "n_5c7b3e2bbcc89b86", "target": "n_b05499651d52353f" } ] } }, "modules": { "n_f2651389ad700e49": { "name": "Prepare Notion page request", "imports": [], "source": "function configuredNotionId(value, name) {\n if (typeof value !== 'string' || !/^(?:[0-9a-f]{32}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i.test(value)) {\n throw new Error('Configure the destination ' + name + ' as its Notion ID');\n }\n return value;\n}\nexport default function calendlyNotionRequest({ invitee, dataSourceId, statusOptionId }) {\n configuredNotionId(dataSourceId, 'data source');\n if (typeof statusOptionId !== 'string' || !statusOptionId.trim() || statusOptionId === 'YOUR_NOTION_STATUS_OPTION_ID') {\n throw new Error('Configure an existing destination Status option ID');\n }\n if (!invitee || typeof invitee !== 'object' || Array.isArray(invitee) || typeof invitee.name !== 'string' || !invitee.name.trim() || typeof invitee.email !== 'string' || !invitee.email.trim()) {\n throw new Error('The Calendly booking must contain an invitee name and email');\n }\n return {\n parent: { type: 'data_source_id', data_source_id: dataSourceId },\n properties: {\n Name: { title: [{ type: 'text', text: { content: invitee.name } }] },\n Email: { email: invitee.email },\n Status: { select: { id: statusOptionId } },\n },\n };\n}\n" }, "n_ddc5f4a606a35b84": { "name": "Check the created Notion page", "imports": [], "source": "export default function notionBookingCreated({ page }) {\n if (!page || typeof page !== 'object' || Array.isArray(page) || page.object !== 'page' || typeof page.id !== 'string' || !page.id.trim()) {\n throw new Error('Notion did not return a created page ID');\n }\n return { page };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }