Kafka Events

Event topics produced by the Lead Generation Service for cross-service communication.

Event Format

All events follow CloudEvents 1.0 specification, partitioned by tenant_id. Topic naming convention: eventzr.leadgen.<entity>.<action>.v1

CloudEvents envelopejson
{
  "specversion": "1.0",
  "type": "eventzr.leadgen.lead.created.v1",
  "source": "/leadgen-svc",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "time": "2026-03-01T12:00:00Z",
  "datacontenttype": "application/json",
  "partitionkey": "tenant-uuid",
  "data": {
    "tenantId": "tenant-uuid",
    "leadId": "lead-uuid",
    "email": "alice@acme.com",
    "source": "form",
    "formId": "form-uuid"
  }
}

Producer Topics (16)

TopicDescriptionPayload Type
eventzr.leadgen.lead.created.v1Emitted when a new lead is captured or createdLeadCreatedEvent
eventzr.leadgen.lead.updated.v1Emitted when lead data is modifiedLeadUpdatedEvent
eventzr.leadgen.lead.status-changed.v1Emitted when lead status transitions (new, qualified, converted, lost)LeadStatusChangedEvent
eventzr.leadgen.lead.scored.v1Emitted after AI scoring completesLeadScoredEvent
eventzr.leadgen.lead.enriched.v1Emitted after third-party enrichmentLeadEnrichedEvent
eventzr.leadgen.lead.assigned.v1Emitted when a lead is assigned to a team memberLeadAssignedEvent
eventzr.leadgen.deal.created.v1Emitted when a new deal is createdDealCreatedEvent
eventzr.leadgen.deal.stage-changed.v1Emitted when a deal moves pipeline stagesDealStageChangedEvent
eventzr.leadgen.deal.won.v1Emitted when a deal is marked as wonDealWonEvent
eventzr.leadgen.deal.lost.v1Emitted when a deal is marked as lostDealLostEvent
eventzr.leadgen.form.submitted.v1Emitted when a form is submitted (after validation)FormSubmittedEvent
eventzr.leadgen.form.published.v1Emitted when a form is publishedFormPublishedEvent
eventzr.leadgen.nurture.step-executed.v1Emitted when a nurture sequence step is executedNurtureStepExecutedEvent
eventzr.leadgen.crm.synced.v1Emitted after successful CRM synchronizationCrmSyncedEvent
eventzr.leadgen.webhook.delivered.v1Emitted after webhook delivery attemptWebhookDeliveredEvent
eventzr.leadgen.segment.updated.v1Emitted when segment membership changesSegmentUpdatedEvent

Consuming Events

To consume leadgen events in another service, subscribe to the relevant topic via KafkaBrokerModule.forAws(). Ensure your consumer group follows the pattern: <consumer-service>-leadgen-consumer