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 WITH candidates AS (\n SELECT id FROM agent_session_notification\n WHERE session_id = $1 AND delivered_at IS NULL\n AND (lease_until IS NULL OR lease_until < now())\n AND (($5::uuid IS NULL AND action_id IS NULL) OR action_id = $5)\n AND ($2 OR wake OR action_id IS NOT NULL)\n ORDER BY created_at, id LIMIT 100 FOR UPDATE SKIP LOCKED\n )\n UPDATE agent_session_notification n SET lease_id = $3,\n lease_until = now() + interval '2 minutes', attempts = attempts + 1,\n action_id = COALESCE(n.action_id, $4)\n FROM candidates c WHERE n.id = c.id\n RETURNING n.id, n.kind, n.subject_id, n.payload, n.created_at,\n n.action_id AS \"action_id!\", n.wake, n.producer_context, n.dedupe_key\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "kind",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "subject_id",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "payload",
"type_info": "Jsonb"
},
{
"ordinal": 4,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 5,
"name": "action_id!",
"type_info": "Uuid"
},
{
"ordinal": 6,
"name": "wake",
"type_info": "Bool"
},
{
"ordinal": 7,
"name": "producer_context",
"type_info": "Jsonb"
},
{
"ordinal": 8,
"name": "dedupe_key",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Uuid",
"Bool",
"Uuid",
"Uuid",
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false,
true,
false,
false,
false
]
},
"hash": "c62ef77ff6d48e49786d2e068bc9f067404540c3c88c67d1016deedd095e5bb4"
}