Skip to main content

The chat step sends a message to chat platforms such as Slack, Discord, and Microsoft Teams.

Return a plain-text body or a rich card. If you return both, Novu uses card. Existing workflows that only return body keep working without changes.

Example usage#

Plain text body#

Rich card#

Build cards with the Card DSL helpers from @novu/framework. The Card DSL extends the raw Chat SDK card model with provider-agnostic Markdown formatting. Novu converts that formatting to the syntax each provider supports.

You can also return a raw card object that matches the schema below. Prefer the helpers so TypeScript catches shape mistakes early.

Card text supports **bold**, _italic_, ~~strikethrough~~, inline code, and [links](https://example.com). For example, Slack receives equivalent mrkdwn, while Novu converts the same source text for other providers.

Note

Link button URLs must be absolute (include https://). Incomplete URLs can fail provider validation at send time.

Chat step output#

Provide at least one of body or card.

body#

  • Type: string
  • Required: No (required if card is omitted)
  • Description: Plain-text message body. If the output also includes card, Novu uses the card and ignores body.

card#

  • Type: object (CardElement)
  • Required: No (required if body is omitted)
  • Description: Structured chat card. Novu provides provider-specific rendering for Slack, Microsoft Teams, WhatsApp, and Telegram. Other providers receive a Markdown fallback generated from the card.

Card properties#

PropertyTypeRequiredDescription
type'card'YesDiscriminator. Set automatically when you use Card().
titlestringNoCard title.
subtitlestringNoSecondary title line.
imageUrlstringNoOptional header image URL.
childrenarrayYesOrdered list of card child elements.

Card child types#

TypeHelpersDescription
textCardTextText block. Optional style: plain, bold, muted.
imageImageImage with url and optional alt.
dividerDividerVisual separator.
linkCardLinkInline link with label and url.
actionsActionsWrapper for link buttons.
link-button(inside Actions)Button that opens a URL. Requires label and url. Optional style: primary, danger, default.
fieldsLabel/value pairs (field children).
tableTable with headers and rows.
sectionNested group of child elements.

The Dashboard block editor authors a common subset of this model (text, image, divider, link buttons, lists, and related layout blocks). Framework also supports the layout elements listed above, including sections, fields, and tables.

Provider overrides#

When you need a provider-native payload that the shared card cannot express, use the step providers object. For example, Slack Block Kit:

The providers object is keyed by provider id. Novu runs this slack function once for the step, and the returned object applies to any Slack integration that sends it. The Framework API cannot target one integration. A Chat step authored in the dashboard can store an override for one integration.

See Providers overrides for the complete code-first API.

Chat step result#

The chat step does not return a result object.