Skip to content
// Read-only view of one conversation (history, lead, flags).
const q = $('Conversation API').first().json.query ?? {};
const id = String(q.wa_id ?? '').replace(/\D/g, '');
const c = ($getWorkflowStaticData('global').convos ?? {})[id];
const now = q.now || new Date().toISOString();
return [{ json: c ? { found: true, ...c, handoff_active: Boolean(c.handoff_until && c.handoff_until > now), window_open: Boolean(c.window_open_until && c.window_open_until > now) } : { found: false, wa_id: id } }];