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 SELECT\n t.id,\n t.latest_inbound_message_ts as last_received,\n t.latest_outbound_message_ts as last_sent,\n first_msg.internal_date_ts as thread_started,\n first_msg.subject,\n (SELECT COUNT(*)::bigint FROM email_messages WHERE thread_id = t.id) as \"message_count!\"\n FROM\n email_threads t\n -- LATERAL join to get subject and timestamp from the first message\n LEFT JOIN LATERAL (\n SELECT internal_date_ts, subject\n FROM email_messages\n WHERE thread_id = t.id\n ORDER BY internal_date_ts ASC NULLS LAST\n LIMIT 1\n ) first_msg ON true\n WHERE\n t.id = $1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "last_received",
"type_info": "Timestamptz"
},
{
"ordinal": 2,
"name": "last_sent",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "thread_started",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "subject",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "message_count!",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
true,
true,
true,
true,
null
]
},
"hash": "dc836e7dd12a3df4a05ba072af32cb1aca7d6b8c20e636adff6fb3977577e62a"
}