Slack

Message Templates and Block Kit

Use event context to build Slack text fallbacks and optional Block Kit messages.

Slack messages have two template fields:

  • Text Fallback is required and becomes the Slack text value.
  • Block Kit JSON is optional and becomes the Slack blocks value.

Template variables use double braces around a path.

{{ event.type }}
{{ workspace.name }}
{{ contact.attributes.email }}

If a path is missing, Leadpush renders it as an empty string.

Common template variables

VariableDescription
event.idUnique event id for the delivery event.
event.typeEvent type, such as contact.created or campaign.slack.
event.occurred_atISO timestamp for when the event occurred.
workspace.uuidWorkspace UUID.
workspace.nameWorkspace name.
contact._idContact id when the event has a contact.
contact.attributes.emailEmail attribute when present.
contact.subscribedContact subscription state when the event has a contact.
changes.beforePrevious values for changed fields when available.
changes.afterNew values for changed fields when available.
campaign.uuidCampaign UUID for campaign Slack workflow deliveries.
campaign.nameCampaign name for campaign Slack workflow deliveries.
workflow.execution_uuidWorkflow execution UUID for campaign Slack deliveries.
workflow.current_step_uuidCurrent workflow step UUID for campaign Slack deliveries.
node.idWorkflow node id for campaign Slack deliveries.
node.typeWorkflow node type for campaign Slack deliveries.
delivery.uuidSlack delivery UUID.
delivery.event_idEvent id stored on the delivery.
destination.uuidDestination UUID.
destination.nameDestination name.

Text fallback examples

{{ event.type }} in {{ workspace.name }}
{{ event.type }} for {{ contact.attributes.email }}
Campaign {{ campaign.name }} reached Slack step {{ node.id }} for {{ contact.attributes.email }}

The rendered text fallback cannot be empty. Include stable context such as {{ event.type }} or {{ workspace.name }} so test events and contact events still produce text when contact fields are missing.

Block Kit JSON

Block Kit templates must be valid JSON with an array as the top-level value. Put template variables inside JSON string values.

[
  {
    "type": "section",
    "text": {
      "type": "mrkdwn",
      "text": "*{{ event.type }}* for `{{ contact.attributes.email }}`"
    }
  }
]

Use Format JSON in the message editor to format valid blocks or catch invalid JSON before saving.

Do not place template variables where JSON expects an object, array, number, boolean, or key name. Keep variables inside quoted string values so the template remains valid JSON after rendering.

Contact lifecycle payload

Contact lifecycle deliveries include the event, workspace, contact, changes, and campaign fields.

{
  "event": {
    "id": "01jz6r7h1k6ts70v9x9p0j4r1a",
    "type": "contact.updated",
    "occurred_at": "2026-04-22T18:30:00+00:00"
  },
  "workspace": {
    "uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "name": "Example Workspace"
  },
  "contact": {
    "_id": "contact_123",
    "workspace_uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "subscribed": true,
    "provider": null,
    "attributes": {
      "email": "person@example.com",
      "first_name": "Avery"
    },
    "created_at": "2026-04-20T14:15:00+00:00",
    "updated_at": "2026-04-22T18:30:00+00:00"
  },
  "changes": {
    "before": {
      "attributes.first_name": "Ava"
    },
    "after": {
      "attributes.first_name": "Avery"
    }
  },
  "campaign": null
}

Test payload

Manual test deliveries use the slack.test event type. They do not include a contact.

{
  "event": {
    "id": "01jz6r7h1k6ts70v9x9p0j4r1b",
    "type": "slack.test",
    "occurred_at": "2026-04-22T18:35:00+00:00"
  },
  "workspace": {
    "uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "name": "Example Workspace"
  },
  "contact": null,
  "changes": {
    "before": {},
    "after": {}
  },
  "campaign": null
}

Campaign Slack payload

Campaign workflow Slack nodes use the campaign.slack event type. They can include contact, campaign, workflow, and node context.

{
  "event": {
    "id": "01jz6r7h1k6ts70v9x9p0j4r1c",
    "type": "campaign.slack",
    "occurred_at": "2026-04-22T18:40:00+00:00"
  },
  "workspace": {
    "uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "name": "Example Workspace"
  },
  "contact": {
    "_id": "contact_123",
    "workspace_uuid": "9a8b7c6d-1111-2222-3333-444455556666",
    "subscribed": true,
    "provider": null,
    "attributes": {
      "email": "person@example.com"
    },
    "created_at": "2026-04-20T14:15:00+00:00",
    "updated_at": "2026-04-22T18:30:00+00:00"
  },
  "changes": {
    "before": {},
    "after": {}
  },
  "campaign": {
    "uuid": "2f0f6c18-1111-2222-3333-444455556666",
    "name": "Trial Onboarding"
  },
  "workflow": {
    "execution_uuid": "7d61b4f0-1111-2222-3333-444455556666",
    "current_step_uuid": "0d71d1a8-1111-2222-3333-444455556666"
  },
  "node": {
    "id": "notify-sales",
    "type": "send_slack"
  }
}

Troubleshooting