Push Benchling Request Notification to Slack
A serverless event-driven integration that posts new Benchling Requests to a Slack channel.
This recipe is outdated
Requests are a legacy feature, and are no longer being enabled for customers. This article is in the process of being modernized. Interested customers should instead consider Benchling Workflows.
The integration below listens for the V2 v2.request.created event over AWS EventBridge. It has no V3 equivalent today: V3 emits no request events, and V3 events are in beta and delivered over webhooks only, not EventBridge. Workflows emit their own V2 events, such as v2.workflowTaskGroup.created; see the Events Reference.
Overview
A guide to a serverless integration using AWS services to connect the Benchling Requests application with your Slack workspace. This integration will use the Benchling Events Framework to post a notification of a newly created Benchling Request to a Slack channel.

High Level Integration Flow

- Benchling Requests: A single system for request submission and fulfillment and an integrated part of the Benchling platform.
- AWS EventBridge: This integration receives Benchling events through AWS EventBridge Partner Event Sources. Benchling can also deliver events to apps over webhooks.
- AWS Lambda: AWS Lambda is a serverless compute service that runs your code in response to events such as EventBridge partner events and automatically manages the underlying compute resources for you.
- AWS CloudWatch: AWS CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time, essentially built-in logs.
- Slack: Cloud-based team collaboration tool commonly used to simplify internal communication in order to increase efficiency.
Prerequisites
- AWS Account with access to AWS EventBridge, AWS Lambda, AWS CloudWatch
- Benchling Events Framework Enabled
- Slack Workspace with Admin permissions to create a Slack App
Benchling Configurations
Benchling Request
Letβs start by configuring a simple Benchling Request within Benchlingβs Admin Request Settings. Refer to the help article for details on configuring a new Request Schema.
For this example use the below JSON to configure a Benchling Request Schema with an optional field βRequest Commentsβ.

Benchling Events
Benchlingβs Events Configuration is part of the Benchling Developer Console and needs to be enabled by a Benchling Admin. Please reach out to your Benchling contact to get access to this functionality.
Next, before continuing, follow the Events Getting Started Guide to subscribe to the v2.request.created event.

AWS EventBridge
After activating your event bus in the linked AWS account, set the following AWS EventBridge event rule pattern to route the v2.request.created event:
Associate the Event Rule to the correct Event Bus
Make sure to select the Benchling event bus you activated from the available event buses dropdown, before creating a new rule. AWS will have a default event bus pre-selected which is not the correct event bus.
If you have other requests configured in Benchling the rule above will apply to all requests. You can add additional fields to the event rule to filter on a specific request.
For example:
Add a CloudWatch Log group target for the event rule to confirm you are able to receive events when a request is created.

Create a new request in Benchling, and check the CloudWatch log group to confirm you are able to receive the event in your AWS environment.
Slack Configuration
Now we can configure our Slack workspace to receive messages via a webhook URL. From the setup we will need the Slack authentication Token and a Webhook URL for our Lambda function.
- Go to https://api.slack.com/apps/ and create a new app in your workspace.
- Go to Incoming Webhooks and activate it and create a webhook URL in the Slack channel you would like to receive the messages.
- Save the Webhook URL that is generated.
- Go into the app settings. Find the OAuth & Permissions options under Features, and save the access token.



Remember the Webhook URL and Slack token will be referenced in our Lambda function.
AWS Lambda
In the same AWS account and region that you set up your EventBridge rule, author a new Lambda function from scratch and select the latest Python runtime.

In the Lambda code editor paste the lambda_function.py file available in the public Benchling Integration Examples GitHub repository.
Create the environment variables referenced in the code, and enter the values from your Slack App settings.

You can leave the remaining basic Lambda settings or adjust appropriately based on the usage of the function. Deploy your function.

The final step is to connect your EventBridge rule to your deployed Lambda function. There are two ways you can do this from the AWS console:
- Directly in the Lambda settings you can Add a trigger for the Lambda function. Use the dropdown to select AWS EventBridge and use the existing rule that we set up.
- Navigate back to the EventBridge rule and edit the rule. You can now add an additional target similar to how we set up the Log Group. Select AWS Lambda in the dropdown options. The Lambda function that was deployed should be available. Donβt forget to update the rule settings after adding the target.
Either of the above options will set up a trigger for your Lambda function as seen below:

π Log into your Benchling account and create a Benchling Request to see the notification posted to the Slack channel! π