Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
{
"db_name": "PostgreSQL",
"query": "\n UPDATE calendar_backfill_jobs\n SET status = 'running',\n started_at = COALESCE(started_at, now()),\n lease_token = $3,\n lease_expires_at = now() + interval '2 minutes',\n last_error = NULL,\n updated_at = now()\n WHERE id = $1\n AND email_link_id = $2\n AND kind = 'google_calendar'\n AND EXISTS (\n SELECT 1\n FROM email_link_google_scopes scopes\n WHERE scopes.link_id = calendar_backfill_jobs.email_link_id\n AND scopes.grant_version = calendar_backfill_jobs.grant_version\n AND scopes.granted_scopes @> $4::text[]\n )\n AND EXISTS (\n SELECT 1\n FROM calendar_accounts account\n WHERE account.id = calendar_backfill_jobs.account_id\n AND account.email_link_id = calendar_backfill_jobs.email_link_id\n AND account.sync_status <> 'disabled'\n )\n AND (\n status = 'pending'\n OR (\n status = 'running'\n AND lease_expires_at < now()\n )\n )\n RETURNING account_id\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "account_id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"TextArray"
]
},
"nullable": [
true
]
},
"hash": "e8d8c97e566cc64b3dc67e7b5d70c6870503185008f8ffb7b54408b1adef6075"
}