{
	"version": 0,
	"name": "Calendar → attendee research",
	"resources": [
		{
			"id": "events",
			"label": "Events",
			"icon": "📅",
			"properties": {
				"Title": "title",
				"When": "date",
				"Event ID": "text",
				"Attendees": "relation"
			}
		},
		{
			"id": "people",
			"label": "People",
			"icon": "👤",
			"properties": {
				"Name": "title",
				"Email": "email",
				"Company": "text",
				"Role": "text",
				"Summary": "text",
				"Status": "select",
				"Events": "relation"
			},
			"notes": "Status is Needs research, Researched or No match."
		}
	],
	"connections": [
		{
			"id": "calendar",
			"label": "Google Calendar",
			"notes": "The calendar to read events from. Read-only."
		}
	],
	"workflows": [
		{
			"id": "sync",
			"name": "Sync calendar",
			"nodes": [
				{
					"id": "fetch",
					"label": "Fetch events in the next 7 days from Google Calendar",
					"uses": ["calendar"],
					"out": {
						"events": [
							{
								"id": "evt_123",
								"title": "Acme intro",
								"start": "2026-09-26T10:00:00Z",
								"attendees": ["ada@acme.com"]
							}
						]
					}
				},
				{
					"id": "upsert",
					"label": "Upsert each event into Events",
					"uses": ["events"],
					"notes": "Match on Event ID so re-runs update rather than duplicate.",
					"out": {
						"attendees": [{ "email": "ada@acme.com", "eventId": "evt_123" }]
					}
				},
				{
					"id": "people",
					"label": "Add new attendees to People as Needs research and link everyone to their events",
					"uses": ["people", "events"],
					"notes": "Skip attendees from our own domain. Existing people are linked, not re-added.",
					"out": null
				}
			],
			"edges": [
				{
					"from": null,
					"to": "fetch",
					"label": "Every hour",
					"shape": { "firedAt": "2026-09-25T09:00:00Z" }
				},
				{ "from": "fetch", "to": "upsert" },
				{ "from": "upsert", "to": "people" },
				{ "from": "people", "to": null }
			]
		},
		{
			"id": "research",
			"name": "Research attendee",
			"state": { "pageId": "…", "email": "ada@acme.com" },
			"nodes": [
				{
					"id": "research",
					"label": "Research agent looks up the person's role, company and recent news",
					"agentic": true,
					"reads": ["email"],
					"out": {
						"company": "Acme",
						"role": "VP Engineering",
						"summary": "Leads platform; recently spoke about…"
					},
					"error": { "shape": { "reason": "No confident match" } }
				},
				{
					"id": "save",
					"label": "Fill in the People page and set Status to Researched",
					"uses": ["people"],
					"reads": ["pageId"],
					"out": null
				},
				{
					"id": "unmatched",
					"label": "Set Status to No match",
					"uses": ["people"],
					"reads": ["pageId"],
					"out": null
				}
			],
			"edges": [
				{
					"from": null,
					"to": "research",
					"label": "When a page is created in People",
					"uses": ["people"],
					"shape": { "pageId": "…", "email": "ada@acme.com", "name": "Ada Lovelace" },
					"writes": ["pageId", "email"]
				},
				{ "from": "research", "to": "save" },
				{ "from": "research.error", "to": "unmatched" },
				{ "from": "save", "to": null },
				{ "from": "unmatched", "to": null }
			]
		}
	]
}
