Stale Deal Nudger
Module 15 · business · intermediate
attach-ai.js
// Pair each AI draft with its deal (same order as Find Stale Deals → Use AI?).
const deals = $('Find Stale Deals').all();
return $input.all().map((item, i) => ({
json: {
...deals[i].json,
draft_subject: item.json.output?.subject ?? `Following up: ${deals[i].json.name}`,
draft_body: item.json.output?.body ?? '',
draft_source: 'ai',
},
}));