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
export async function main({ macro, trigger, knobs }: StepContext) {
if (trigger.kind !== 'event') return { posted: false };
const name = trigger.item.item?.name ?? 'A task';
for await (const channel of macro.channels.list()) {
if ((await channel.name()) === knobs.channel) {
await channel.send(`Done: ${name}`);
return { posted: true };
}
}
throw new Error(`There's no channel named "${knobs.channel}". Change the channel this routine posts in.`);
}