Salesforce lifecycle and lead-stage automation with historical tracking
Build a workflow that automates Salesforce "lifecycle loop" (funnel) management for a revenue/marketing ops team: as leads and contacts move through the funnel, it evaluates stage-transition rules (entry/exit criteria, score thresholds, SLA timers, date stamping) and writes the results back to the CRM. The design principle is "send IDs, decide in the automation": the CRM trigger sends only IDs and event context, and the workflow queries the live record for everything else, keeping all business logic centralized instead of scattered across CRM automation. Triggers: A webhook endpoint that your CRM (e.g. Salesforce, or your CRM of choice) calls whenever a relevant record event fires (campaign membership created, activity logged, opportunity contact role added, stage changed, score changed, lead converted, account ICP change, etc). Gate it with a domain/origin trust check so only your real CRM org can call it, and add an idempotency/replay guard (dedupe on event + subject id within a short window) so a retried callout can't double-move a stage. A daily scheduled job that recycles stale "Working" loops that have gone quiet. A couple of SSO-gated manual web forms for reps to log a disposition or a meeting outcome by hand. An "opportunity created" callback route for the CRM-side flow that creates opportunities. Main steps/flow: A lightweight trigger/gate step that validates and normalizes the inbound event payload, and exposes an API contract so the CRM's integration layer can register it as an external service. A hydration step that resolves the subject lead/contact, queries the CRM for the core record plus related campaign memberships and opportunity roles, and opens an audit-log entry for the run. A loop-evaluation step (read-only "dry run") that decides whether to create, re-open, or leave alone a lifecycle loop for the subject. A stage-transition evaluation step (also dry-run) that decides which stage dates to stamp and what the new funnel stage should be — covering inbound entry stages, a "working" stage triggered by sales activity, and an "active opportunity" stage — and computes SLA due dates/completion for a qualified-lead response-time clock. A write-back step that actually executes the decided loop and stage changes against the CRM, stamps the triggering record, and guards against duplicate active loops. Supporting steps for closing won/lost loops, recycling stale loops on the schedule, re-evaluating an account's contacts when account-level scoring changes, reparenting a converted lead's loop to the new contact, provisioning any custom fields the workflow needs, auditing/reporting on the data (an audit step plus a periodic report), and a shared alerting helper that posts structured alerts to your team chat tool (e.g. Slack) whenever a step errors or flags something. Connectors/external services: Your CRM (e.g. Salesforce) — authenticate outbound into it via OAuth to query and write records (SOQL-style queries and record writes), and set it up to call back into this workflow via a named/external credential pointing at this workflow's webhook route. Your team chat tool (e.g. Slack) — used by the alerting helper to post error/flag notifications to an ops channel. Optionally, a docs/notes tool (e.g. Notion) for a helper step that pulls in project build notes — not part of the runtime logic. Keep all the specific stage thresholds, date-stamping rules, and SLA math in one clearly documented "logic reference" step/doc so the rules are reproducible and auditable independent of the code, and log every decision to a durable audit trail. Gate the manual forms and any admin routes with SSO; keep the CRM webhook route protected with an unguessable id plus the domain-trust check rather than making it public. Tools used: Salesforce, Slack, Notion, 3B
What this prompt builds
This workflow automates Salesforce lifecycle and lead-stage management for revenue operations teams. It centralizes all stage-transition logic in 3B — evaluating scoring, SLA timers, and funnel rules triggered by CRM events — then writes decisions back to Salesforce with a full audit trail. The architecture allows leads and contacts to cycle through multiple lifecycle journeys, surfacing re-engagement intent and removing manual stage-progression work from XDRs and sales reps.
The problem
Revenue operations teams struggle to track leads and contacts through multiple lifecycle journeys in Salesforce — once a lead progresses through stages, the CRM can't natively capture subsequent re-engagement or intent signals. Manual stage progression creates inconsistency, XDRs and sales reps must remember complex rules, and business logic scattered across CRM automation becomes hard to audit or change. This workflow solves it by centralizing all lifecycle and stage-transition logic in 3B: the CRM sends event triggers (campaign membership, activity logged, score change, opportunity created), and the workflow evaluates scoring thresholds, SLA timers, entry/exit criteria, and date-stamping rules in one place, then writes the decision and a full audit log back to Salesforce. It creates a new lifecycle-loop record for each journey, so teams can see historical progressions and resurface leads when inbound intent returns.
Solution and impact
Stage progression is now automated and consistent — XDRs and sales reps no longer need to know or apply funnel rules by hand. When a lead or contact re-engages through inbound channels, the workflow automatically creates a new lifecycle loop, captures the intent signal, and surfaces the person to XDRs for review again. All business logic lives in a single, auditable automation with a durable decision log, so RevOps can reproduce, report on, and refine lifecycle rules without hunting through scattered CRM triggers and flows.