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 INSERT INTO email_messages (\n id, provider_id, link_id, thread_id, provider_thread_id,\n replying_to_id, subject, from_contact_id, sent_at,\n has_attachments, is_read, is_starred, is_sent, is_draft,\n body_text, body_html_sanitized, body_macro, headers_jsonb,\n created_at, updated_at, draft_generation\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)\n ON CONFLICT (id) DO UPDATE SET\n provider_id = COALESCE(email_messages.provider_id, EXCLUDED.provider_id),\n thread_id = EXCLUDED.thread_id,\n provider_thread_id = COALESCE(email_messages.provider_thread_id, EXCLUDED.provider_thread_id),\n replying_to_id = EXCLUDED.replying_to_id,\n subject = EXCLUDED.subject,\n from_contact_id = EXCLUDED.from_contact_id,\n sent_at = EXCLUDED.sent_at,\n is_read = EXCLUDED.is_read,\n is_starred = EXCLUDED.is_starred,\n is_sent = EXCLUDED.is_sent,\n is_draft = EXCLUDED.is_draft,\n body_text = EXCLUDED.body_text,\n body_html_sanitized = EXCLUDED.body_html_sanitized,\n body_macro = EXCLUDED.body_macro,\n headers_jsonb = EXCLUDED.headers_jsonb,\n updated_at = NOW()\n WHERE email_messages.link_id = EXCLUDED.link_id\n AND email_messages.draft_generation = $21\n AND email_messages.is_draft AND NOT email_messages.is_sent\n AND NOT EXISTS (SELECT 1 FROM email_mailbox_drafts d WHERE d.message_id = EXCLUDED.id AND d.delete_requested)\n AND NOT EXISTS (SELECT 1 FROM email_scheduled_messages WHERE message_id = EXCLUDED.id AND link_id = EXCLUDED.link_id)\n AND NOT EXISTS (SELECT 1 FROM email_send_attempts WHERE message_id = EXCLUDED.id AND link_id = EXCLUDED.link_id AND NOT cancelled AND NOT sent)\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Text",
"Uuid",
"Uuid",
"Text",
"Uuid",
"Text",
"Uuid",
"Timestamptz",
"Bool",
"Bool",
"Bool",
"Bool",
"Bool",
"Text",
"Text",
"Text",
"Jsonb",
"Timestamptz",
"Timestamptz",
"Int4"
]
},
"nullable": []
},
"hash": "30c603a1a2cf800cfe56a426f6489356d17d82b29a3d367eff91cd33f70a306c"
}