---
title: What is Knock?
description: Learn more about what Knock does and how it helps power your product messaging.
tags: ["getting started", "explainer", "explained"]
section: Getting started
---

Knock is product and customer messaging infrastructure. You can use Knock to power all of your product's messaging needs, including transactional messaging, lifecycle marketing, one-time announcements, and in-product messaging, without the effort of building and maintaining your own in-house messaging system.

In this overview, we'll cover the foundational concepts of Knock. Knock is designed to be used collaboratively by engineering, product, and growth teams. It's quick for developers to implement, and simple for non-technical roles to manage.

## Sending messages with Knock

Knock enables three core messaging experiences:

- **Workflows.** Transactional and lifecycle messaging flows that respond to user actions and events.
- **Broadcasts.** One-time messages sent to groups of users for announcements, updates, and campaigns.
- **Guides.** In-app lifecycle messaging that helps users discover features and complete key actions.

### Workflows

Workflows enable you to model complex messaging flows across channels using a variety of logical function steps while respecting a user's individual preferences. Workflows power both transactional messaging (such as order confirmations, password resets, and account updates) and lifecycle messaging (such as onboarding sequences, engagement campaigns, and retention flows).

<Image
  src="/images/what-is-knock/workflow-diagram-3.png"
  alt="An image of a workflow diagram"
  width={1356}
  height={1452}
  className="rounded-md mx-auto border border-gray-200"
/>

Workflows can be triggered in several ways: via a direct API call, from a source event in a CDP like Segment, on a recurring or one-off schedule, or automatically when a user joins an audience.

<AccordionGroup>
  <Accordion title="API call" anchorSlug="api-call">
    Trigger workflows programmatically using our [REST API](/reference) or any
    of our [available SDKs](/developer-tools/sdks) when events happen in your
    application.

    <MultiLangCodeBlock snippet="workflows.trigger" title="Trigger a workflow" />

  </Accordion>
  <Accordion title="Source event" anchorSlug="source-event">
    Connect a CDP like [Segment](/integrations/sources/segment) as an event
    source to automatically trigger workflows based on events tracked in your
    analytics platform.

    ```javascript title="Segment track call"
    analytics.track("New Comment", {
      userId: "user_123",
      properties: {
        comment_id: "comment_456",
        project_name: "My Project",
        commenter: {
          id: "user_789",
          name: "John Hammond"
        }
      }
    });
    ```

  </Accordion>
  <Accordion title="Schedule" anchorSlug="schedule">
    [Schedule workflows](/concepts/schedules) to run at specific times or
    intervals for time-based notifications like reminders or recurring updates.

    ```typescript title="Create a recurring schedule"
    import Knock from "@knocklabs/node";
    const client = new Knock({ apiKey: process.env.KNOCK_API_KEY });

    await client.schedules.create({
      recipients: ["user_123", "user_456"],
      workflow: "weekly-digest",
      repeats: [
        {
          frequency: "weekly",
          days: ["mon"],
          hours: 9,
        },
      ],
    });
    ```

  </Accordion>
  <Accordion title="Audience membership" anchorSlug="audience-membership">
    Automatically trigger workflows when users are added to an
    [audience](/concepts/audiences). With static audiences, you add users via
    the API, a CSV upload, or a reverse ETL tool. With dynamic audiences, users
    automatically enter and exit based on query rules you define on their
    properties.

    ```typescript title="Add users to a static audience"
    import Knock from "@knocklabs/node";
    const client = new Knock({ apiKey: process.env.KNOCK_API_KEY });

    await client.audiences.addMembers("new-signups", {
      members: ["user_123", "user_456"],
    });
    ```

  </Accordion>
</AccordionGroup>

### Broadcasts

Broadcasts enable you to send one-time messages to groups of users for communications that aren't triggered by individual user actions. Unlike workflows that are event-driven, broadcasts are initiated directly from the Knock dashboard and can target specific audiences you've created in Knock.

<Image
  src="/images/what-is-knock/broadcast-editor.png"
  alt="An image of the broadcast editor"
  width={1356}
  height={1452}
  className="rounded-md mx-auto border border-gray-200"
/>

Broadcasts are perfect for:

- Product announcements and feature releases
- Marketing campaigns and promotional messages
- System maintenance notifications
- Company updates and newsletters
- Time-sensitive alerts and emergency communications

### Guides

Guides power in-app lifecycle messaging using your own components and design system. Unlike traditional messaging that happens outside your app, guides appear contextually within your product interface to provide timely, relevant guidance.

<Image
  src="/images/what-is-knock/guides-editor.png"
  alt="An image of the guides editor"
  width={1356}
  height={1452}
  className="rounded-md mx-auto border border-gray-200"
/>

Guides enable you to:

- Create interactive onboarding flows
- Highlight new features and updates
- Guide users through complex workflows
- Drive adoption of key product features
- Provide contextual help and tips

## Mapping your data into Knock

### Users

In most cases, recipients are [users](/concepts/users) in your application. As you trigger workflows for recipients, Knock creates a cache of the data needed to notify them on different platforms, such as an email address, phone number, avatar URL, or push token. Knock also stores custom properties you pass from your application to customize their notifications, such as a plan type, user role, or timezone.

```javascript title="An object used to create a User"
{
	// Id is a required prop
	id: "1",
	// Knock also supports default props for common channels
	name: "John Hammond",
	email: "hammondj@ingen.net",
	phone_number: "555-555-5555",
	avatar: "https://ingen.net/headshots/hammondj.jpg",
	timezone: "America/Costa_Rica"
	// You can add as many custom props as needed. These will be
	// merged onto the top-level User object
	properties: {
		"title": "CEO",
		"planType": "allAccess",
		"userType": "admin"
	}
}
```

### Audiences

[Audiences](/concepts/audiences) are defined user segments that can be used to target workflows, guides, and broadcasts. You can build static audiences by manually adding users via a reverse ETL source such as Hightouch or Census, a CSV upload, the API, or manually in the Knock dashboard, or you can build dynamic audiences with a set of query rules on top of the user data in Knock.

### Tenants

[Tenants](/concepts/tenants) represent accounts, organizations, or workspaces your users belong to. They allow you to map your product's structure into Knock to power tenant-specific features like branding or preferences.

### Objects

[Objects](/concepts/objects) allow you to map custom entities into your project and relate them to users with a subscription. They can help you ensure Knock always has the most up-to-date information required to send your notifications, and they enable you to send notifications to non-user recipients.

## Channels

Channels in Knock represent a specific provider you have configured to send messages. You can include channel steps in your workflows or use them in broadcasts to send messages with the providers you already use in production. Knock supports the following channel types and providers:

<AccordionGroup>
  <Accordion title="Email" anchorSlug="email">
    Knock comes with a [built-in email channel](/integrations/email/knock-test)
    and also supports sending email with [Amazon
    SES](/integrations/email/aws-ses),
    [Mailersend](/integrations/email/mailersend),
    [Mailgun](/integrations/email/mailgun),
    [Mailjet](/integrations/email/mailjet),
    [Mailtrap](/integrations/email/mailtrap),
    [Mandrill](/integrations/email/mandrill),
    [Postmark](/integrations/email/postmark),
    [Resend](/integrations/email/resend),
    [Sendgrid](/integrations/email/sendgrid), [SMTP](/integrations/email/smtp),
    and [Sparkpost](/integrations/email/sparkpost).
  </Accordion>
  <Accordion title="SMS" anchorSlug="sms">
    Knock supports sending SMS with [Africa's
    Talking](/integrations/sms/africas-talking), [AWS
    SNS](/integrations/sms/aws-sns), [Mailersend](/integrations/sms/mailersend),
    [MessageBird](/integrations/sms/messagebird),
    [Plivo](/integrations/sms/plivo), [Sinch](/integrations/sms/sinch), [Sinch
    MessageMedia](/integrations/sms/sinch-message-media),
    [Telnyx](/integrations/sms/telnyx), [Twilio](/integrations/sms/twilio), and
    [Vonage](/integrations/sms/vonage).
  </Accordion>
  <Accordion title="Push" anchorSlug="push">
    Knock supports sending push messages with [Apple Push Notification Service
    (iOS)](/integrations/push/apns), [Expo (React
    Native)](/integrations/push/expo), [Firebase Cloud Messaging
    (Android)](/integrations/push/firebase), and
    [OneSignal](/integrations/push/one-signal).
  </Accordion>
  <Accordion title="Chat" anchorSlug="chat">
    Knock supports sending chat messages with [Slack](/integrations/chat/slack),
    [Discord](/integrations/chat/discord), [Microsoft
    Teams](/integrations/chat/microsoft-teams),
    [WhatsApp](/integrations/chat/whatsapp).
  </Accordion>
  <Accordion title="In-app feed" anchorSlug="in-app-feed">
    Knock provides [a real-time in-app feed API](/integrations/in-app/knock) for
    receiving notifications, along with drop-in components to display them to
    your users.
  </Accordion>
  <Accordion title="In-app guide" anchorSlug="in-app-guide">
    Knock enables you to build [in-app guides](/in-app-ui/guides/overview) that
    display contextual messages within your product using your own components
    and design system.
  </Accordion>
</AccordionGroup>

A message that is generated as a part of a workflow or broadcast is called a Message, and Knock enables you to define dynamic message templates using a combination of a drag-and-drop editor and the Liquid templating language.

This helps product and marketing teams standardize on one templating system instead of using different templating languages for different providers. It also has the added benefit of lifting these messages out of your codebase so you can iterate quickly on customer communications without a developer.

## Functions

Each workflow can combine multiple function steps to model complex logic that creates better notification experiences. You can combine the following function steps with any number of channel steps to create personalized notifications for your users:

<AccordionGroup>
  <Accordion title="Batch" anchorSlug="batch">
    [A batch step](/designing-workflows/batch-function) condenses multiple
    activities into one notification, e.g. batch all of the comments on this
    document for one hour and then send one email with all of the activities.
  </Accordion>
  <Accordion title="Delay" anchorSlug="delay">
    [A delay step](/designing-workflows/delay-function) waits for a specified
    duration before proceeding to the next step in a workflow, e.g. send the new
    user a follow-up email ten days after they sign up.
  </Accordion>
  <Accordion title="Branch" anchorSlug="branch">
    [A branch step](/designing-workflows/branch-function) uses multiple
    conditions to execute different branches of logic, e.g. if `user.planType
    === 'pro'` send them email A, else send them email B.
  </Accordion>
  <Accordion title="Experiment" anchorSlug="experiment">
    [An experiment step](/designing-workflows/experiment-function) splits
    recipients into randomized, percentage-based cohorts for A/B testing and
    experimentation, e.g. send 50% of recipients email template A and 50% email
    template B to measure engagement.
  </Accordion>
  <Accordion title="Throttle" anchorSlug="throttle">
    [A throttle step](/designing-workflows/throttle-function) controls how many
    times a user is notified for a particular workflow over a specified
    duration, e.g. trigger the `server is down` workflow every minute while the
    server is down, but only send a max of one email every 5 minutes.
  </Accordion>
  <Accordion title="Fetch" anchorSlug="fetch">
    [A fetch step](/designing-workflows/fetch-function) makes an HTTP request to
    an external service and uses the returned data in subsequent steps, e.g.
    query an MLS API for recent home sales in the user's zip code and render
    them in an email.
  </Accordion>
  <Accordion title="AI agent" anchorSlug="ai-agent">
    [An AI agent step](/designing-workflows/ai-agent-function) runs a prompt on
    an AI model and merges the response into workflow state, e.g. enrich
    recipient data using their domain to personalize welcome messaging.
  </Accordion>
  <Accordion title="Trigger workflow" anchorSlug="trigger-workflow">
    [A trigger workflow step](/designing-workflows/trigger-workflow-function)
    allows you to trigger another workflow from within the current workflow,
    e.g. trigger a "welcome_sequence" workflow after recieving an
    "account_setup" notification.
  </Accordion>
</AccordionGroup>

In addition to combining channel steps and function steps to create complex workflows, you can augment these steps with additional logic based on the user recipient, inputs from your application, or the status of previous workflow steps. These are called step conditions.

## Step conditions

Step conditions exist across both channel and function steps, and they allow you to conditionally execute steps based on trigger payload data, user properties, or the status of previous steps.

**Examples:**

- Only send an email message if an in-app message has not been seen
- Only send an in-app notification if `recipient.plan === "pro"`
- Only execute a delay step if `delay === true` in the trigger payload

In addition to giving your technical and non-technical users the ability to construct these workflows via a drag-and-drop editor, Knock also enables your users to exercise control over their own notification experience using a flexible preferences model.

## Preferences

In Knock, each workflow run and broadcast is executed on behalf of a recipient, and each recipient can specify their preferences to receive messages across a number of different criteria: channel types, individual workflows, workflow categories, and broadcast types.

<Image
  src="/images/what-is-knock/preferences.png"
  alt="An image of a preference set"
  width={1356}
  height={1452}
  className="rounded-md mx-auto border border-gray-200"
/>

Application developers have control over how these preference sets are presented to the user and which options to surface, but Knock enforces these preferences during every workflow run and broadcast automatically.

You can learn more about how to set a user's preferences in our [preferences overview](/preferences/overview).

## Next steps

Now that you understand some of the core concepts of Knock, you can either start building with Knock or explore some of the more advanced features Knock offers.

### Build something

If you want to start by adding Knock to your existing system, you can check out our quick start guide to implement your first workflow. This quick start will help you integrate Knock with your backend codebase.

<SdkCardGroup>
  <SdkCard
    title="Quick start guide"
    linkUrl="/getting-started/quick-start/general"
    icon="code"
    languages={["Your codebase"]}
  />
  <SdkCard
    title="React quick start"
    linkUrl="/getting-started/quick-start/react"
    icon="react"
    languages={["React"]}
  />
  <SdkCard
    title="Next.js quick start"
    linkUrl="/getting-started/quick-start/nextjs"
    icon="nextjs"
    languages={["Next.js"]}
  />
</SdkCardGroup>

If you want to keep learning about Knock using a curated example application, check out our catalog of [examples apps](/getting-started/example-apps). Here are some recommendations:

<SdkCardGroup>
  <SdkCard
    title="In-app feed & toasts"
    linkUrl="https://github.com/knocklabs/in-app-notifications-example-nextjs"
    icon="react"
    languages={["React", "Next.js"]}
    isExternal={true}
  />
  <SdkCard
    title="SlackKit example"
    linkUrl="https://github.com/knocklabs/slack-kit-example"
    icon="react"
    languages={["React", "Next.js"]}
    isExternal={true}
  />
  <SdkCard
    title="iOS example"
    linkUrl="https://github.com/knocklabs/ios-example-app"
    icon="swift"
    languages={["Swift"]}
    isExternal={true}
  />
</SdkCardGroup>

### Keep learning

While workflows, broadcasts, and guides are at the heart of Knock, our goal is to build a complete messaging system for our customers. Here is an overview of some of the more-advanced features that we provide.

#### UI components

Knock provides developers with React components like `<NotificationFeed/>` and `<SlackAuthButton/>` to use in their applications. You can read more about building in-app UI with Knock for both web and mobile [here](/in-app-ui/overview).

#### Advanced concepts

There is a lot more to learn about Knock, and our [concepts overview page](/concepts/overview) is a good place to start. Here are use cases our customers commonly solve with Knock:

- Powering [translation and localization](/template-editor/translations) and managing timezone-aware delivery.
- Creating advanced messaging logic using [subscriptions](/concepts/subscriptions) and [schedules](/concepts/schedules).
- Integrating Knock with your application's data model, using [tenants](/concepts/tenants) and [objects](/concepts/objects) to power customized experiences.
- Using [the template editor](/template-editor/overview) to standardize messaging templates across providers.

#### Developer tools

Knock is a developer-first platform, with both [environment](/concepts/environments) and [commit models](/concepts/commits). If you want to work with Knock resources in code, you can use our [Management API](/developer-tools/management-api) or [CLI](/developer-tools/knock-cli).

Knock also supports an [MCP](/ai/mcp-server) server, which allows you to work with Knock resources in your IDE, entirely using natural language. Our MCP server is a great way to migrate from a legacy system to Knock, or to make updates across many Knock resources at once.

Once you're sending messages through Knock, we offer observability tools like [workflow run logs](/send-notifications/debugging-workflows) (to examine all steps of workflow execution in your dashboard) and data streaming into a monitoring system like Datadog with [extensions](/integrations/extensions/overview).
