The documentation you are viewing is for Dapr v1.7 which is an older version of Dapr. For up-to-date documentation, see the latest version.

Bindings overview

Overview of the bindings API building block

Using Dapr’s bindings API, you can trigger your app with events coming in from external systems and interface with external systems. With the bindings API, you can:

  • Avoid the complexities of connecting to and polling from messaging systems, such as queues and message buses.
  • Focus on business logic, instead of the implementation details of interacting with a system.
  • Keep your code free from SDKs or libraries.
  • Handle retries and failure recovery.
  • Switch between bindings at runtime.
  • Build portable applications with environment-specific bindings set-up and no required code changes.

For example, with bindings, your microservice can respond to incoming Twilio/SMS messages without:

  • Adding or configuring a third-party Twilio SDK
  • Worrying about polling from Twilio (or using WebSockets, etc.)

Input bindings

With input bindings, you can trigger your application when an event from an external resource occurs. An optional payload and metadata may be sent with the request.

To receive events from an input binding:

  1. Define the component YAML that describes the binding type and its metadata (connection info, etc.).
  2. Listen for the incoming event using:
    • An HTTP endpoint
    • The gRPC proto library to get incoming events.

Read the Create an event-driven app using input bindings guide to get started with input bindings.

Output bindings

With output bindings, you can invoke external resources. An optional payload and metadata can be sent with the invocation request.

To invoke an output binding:

  1. Define the component YAML that describes the binding type and its metadata (connection info, etc.).
  2. Use the HTTP endpoint or gRPC method to invoke the binding with an optional payload.

Read the Use output bindings to interface with external resources guide to get started with output bindings.

Try out bindings

Quickstarts and tutorials

Want to put the Dapr bindings API to the test? Walk through the following quickstart and tutorials to see bindings in action:

Quickstart/tutorial Description
Bindings quickstart Work with external systems using input bindings to respond to events and output bindings to call operations.
Bindings tutorial Demonstrates how to use Dapr to create input and output bindings to other components. Uses bindings to Kafka.

Start using bindings directly in your app

Want to skip the quickstarts? Not a problem. You can try out the bindings building block directly in your application to invoke output bindings and trigger input bindings. After Dapr is installed, you can begin using the bindings API starting with the input bindings how-to guide.

Next Steps


Last modified July 5, 2022: [Bindings] Docset refresh (#2595) (dd445be3)