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": "WITH result AS (\n SELECT CASE\n WHEN j.cancel_requested_at IS NOT NULL THEN CASE WHEN EXISTS (\n SELECT 1 FROM slack_import_conversation WHERE job_id = j.id\n AND (status = 'importing' OR search_state IN ('pending', 'submitted', 'failed'))\n ) OR EXISTS (SELECT 1 FROM slack_import_message_reference\n WHERE job_id = j.id AND completed_at IS NULL)\n THEN 'cancelling' ELSE 'cancelled' END\n WHEN j.registration_closed_at IS NULL THEN 'uploading'\n WHEN EXISTS (SELECT 1 FROM slack_import_conversation WHERE job_id = j.id\n AND (status IN ('awaiting_uploads', 'queued', 'importing')\n OR search_state IN ('pending', 'submitted', 'failed'))) THEN 'processing'\n WHEN EXISTS (SELECT 1 FROM slack_import_message_reference\n WHERE job_id = j.id AND completed_at IS NULL) THEN 'processing'\n WHEN NOT EXISTS (SELECT 1 FROM slack_import_conversation WHERE job_id = j.id AND status = 'failed') THEN 'completed'\n WHEN EXISTS (SELECT 1 FROM slack_import_conversation WHERE job_id = j.id AND (status = 'completed' OR imported > 0))\n THEN 'completed_with_errors'\n ELSE 'failed' END AS status\n FROM slack_import_job j WHERE j.id = $1\n ) UPDATE slack_import_job j SET status = r.status, revision = revision + 1, updated_at = clock_timestamp(),\n settled_at = CASE WHEN r.status IN ('completed', 'completed_with_errors', 'failed', 'cancelled')\n THEN coalesce(j.settled_at, clock_timestamp()) ELSE NULL END\n FROM result r WHERE j.id = $1\n AND j.status NOT IN ('completed', 'completed_with_errors', 'failed', 'cancelled')",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "a5cce4c93b2edc3a1cb95e8abdb428abc2fb2b728da758b273e913ac89764e2b"
}