Email Notification¶
Class: EmailNotificationBlockV1
Source: inference.core.workflows.core_steps.sinks.email_notification.v1.EmailNotificationBlockV1
The Email Notification block allows users to send email notifications as part of a workflow. It requires SMTP server setup to send the notification
Customizable Email Content¶
-
Subject: Set the subject field to define the subject line of the email.
-
Message: Use the message field to write the body content of the email. Message can be parametrised with data generated during workflow run. See Dynamic Parameters section.
-
Recipients (To, CC, BCC): Define who will receive the email using
receiver_email
,cc_receiver_email
, andbcc_receiver_email
properties. You can input a single email or a list.
Dynamic Parameters¶
Content of the message can be parametrised with Workflow execution outcomes. Take a look at the example message using dynamic parameters:
message = "This is example notification. Predicted classes: {{ $parameters.predicted_classes }}"
Message parameters are delivered by Workflows Execution Engine by setting proper data selectors in
message_parameters
field, for example:
message_parameters = {
"predicted_classes": "$steps.model.predictions"
}
Selecting data is not the only option - data may be processed in the block. In the example below we wish to
extract names of predicted classes. We can apply transformation for each parameter by setting
message_parameters_operations
:
message_parameters_operations = {
"predictions": [
{"type": "DetectionsPropertyExtract", "property_name": "class_name"}
]
}
As a result, in the e-mail that will be sent, you can expect:
This is example notification. Predicted classes: ["class_a", "class_b"].
Configuring SMTP server¶
Those are the parameters configuring SMTP server:
-
smtp_server
- hostname of the SMTP server to use -
sender_email
- e-mail account to be used as sender -
sender_email_password
- password for sender e-mail account -
smtp_port
- port of SMTP service - defaults to465
Block enforces SSL over SMTP.
Typical scenario for using custom SMTP server involves sending e-mail through Google SMTP server. Take a look at Google tutorial to configure the block properly.
GMAIL password will not work if 2-step verification is turned on
GMAIL users choosing custom SMTP server as e-mail service provider must configure application password to avoid problems with 2-step verification protected account. Beware that application password must be kept protected - we recommend sending the password in Workflow input and providing it each time by the caller, avoiding storing it in Workflow definition.
Cooldown¶
The block accepts cooldown_seconds
(which defaults to 5
seconds) to prevent unintended bursts of
notifications. Please adjust it according to your needs, setting 0
indicate no cooldown.
During cooldown period, consecutive runs of the step will cause throttling_status
output to be set True
and no notification will be sent.
Cooldown limitations
Current implementation of cooldown is limited to video processing - using this block in context of a
Workflow that is run behind HTTP service (Roboflow Hosted API, Dedicated Deployment or self-hosted
inference
server) will have no effect for processing HTTP requests.
Attachments¶
You may specify attachment files to be send with your e-mail. Attachments can only be generated in runtime by dedicated blocks (for instance CSV Formatter)
To include attachments, simply provide the attachment name and refer to other block outputs:
attachments = {
"report.pdf": "$steps.report_generator.output"
}
Async execution¶
Configure the fire_and_forget
property. Set it to True if you want the email to be sent in the background, allowing the
Workflow to proceed without waiting on e-mail to be sent. In this case you will not be able to rely on
error_status
output which will always be set to False
, so we recommend setting the fire_and_forget=False
for
debugging purposes.
Disabling notifications based on runtime parameter¶
Sometimes it would be convenient to manually disable the e-mail notifier block. This is possible
setting disable_sink
flag to hold reference to Workflow input. with such setup, caller would be
able to disable the sink when needed sending agreed input parameter.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/email_notification@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
subject |
str |
Subject of the message. | ❌ |
message |
str |
Content of the message to be send. | ❌ |
sender_email |
str |
E-mail to be used to send the message. | ✅ |
receiver_email |
Union[List[str], str] |
Destination e-mail address. | ✅ |
cc_receiver_email |
Optional[List[str], str] |
Destination e-mail address. | ✅ |
bcc_receiver_email |
Optional[List[str], str] |
Destination e-mail address. | ✅ |
message_parameters |
Dict[str, Union[bool, float, int, str]] |
References data to be used to construct each and every column. | ✅ |
message_parameters_operations |
Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, RandomNumber, SequenceAggregate, SequenceApply, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, ToBoolean, ToNumber, ToString]]] |
UQL definitions of operations to be performed on defined data w.r.t. each message parameter. | ❌ |
smtp_server |
str |
Custom SMTP server to be used. | ✅ |
sender_email_password |
str |
Sender e-mail password be used when authenticating to SMTP server. | ✅ |
smtp_port |
int |
SMTP server port. | ❌ |
fire_and_forget |
bool |
Boolean flag dictating if sink is supposed to be executed in the background, not waiting on status of registration before end of workflow run. Use True if best-effort registration is needed, use False while debugging and if error handling is needed. |
✅ |
disable_sink |
bool |
boolean flag that can be also reference to input - to arbitrarily disable data collection for specific request. | ✅ |
cooldown_seconds |
int |
Number of seconds to wait until follow-up notification can be sent. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow
runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Email Notification
in version v1
.
- inputs:
Pixelate Visualization
,Gaze Detection
,CLIP Embedding Model
,Blur Visualization
,OCR Model
,Mask Visualization
,Object Detection Model
,SIFT
,Line Counter
,YOLO-World Model
,Cache Get
,Halo Visualization
,Environment Secrets Store
,Grid Visualization
,Google Vision OCR
,Email Notification
,Camera Focus
,Image Threshold
,Byte Tracker
,Template Matching
,Image Preprocessing
,Roboflow Dataset Upload
,Relative Static Crop
,Background Color Visualization
,Bounding Box Visualization
,Image Contours
,Triangle Visualization
,Bounding Rectangle
,Absolute Static Crop
,Distance Measurement
,Time in Zone
,Florence-2 Model
,Detections Stitch
,SIFT Comparison
,Keypoint Detection Model
,Local File Sink
,Expression
,Roboflow Custom Metadata
,Cache Set
,Crop Visualization
,Clip Comparison
,Dynamic Zone
,SIFT Comparison
,Image Convert Grayscale
,Single-Label Classification Model
,Identify Outliers
,Florence-2 Model
,Time in Zone
,OpenAI
,Path Deviation
,Color Visualization
,Pixel Color Count
,Multi-Label Classification Model
,Property Definition
,Multi-Label Classification Model
,Path Deviation
,Stitch Images
,LMM For Classification
,First Non Empty Or Default
,Keypoint Detection Model
,Line Counter
,Instance Segmentation Model
,Rate Limiter
,Single-Label Classification Model
,Detections Filter
,Model Monitoring Inference Aggregator
,Polygon Visualization
,VLM as Detector
,Model Comparison Visualization
,CogVLM
,Keypoint Visualization
,Detections Classes Replacement
,Data Aggregator
,Detection Offset
,Slack Notification
,Stitch OCR Detections
,Identify Changes
,Clip Comparison
,Ellipse Visualization
,Label Visualization
,Classification Label Visualization
,Line Counter Visualization
,Byte Tracker
,LMM
,Stability AI Inpainting
,Reference Path Visualization
,VLM as Detector
,Dynamic Crop
,Dominant Color
,Byte Tracker
,Object Detection Model
,Barcode Detection
,Corner Visualization
,Perspective Correction
,Cosine Similarity
,Polygon Zone Visualization
,VLM as Classifier
,Dimension Collapse
,Continue If
,Twilio SMS Notification
,Size Measurement
,Webhook Sink
,OpenAI
,Image Slicer
,Detections Consensus
,Trace Visualization
,Instance Segmentation Model
,Buffer
,Roboflow Dataset Upload
,VLM as Classifier
,Anthropic Claude
,Image Blur
,Circle Visualization
,Dot Visualization
,Google Gemini
,QR Code Detection
,Segment Anything 2 Model
,JSON Parser
,Detections Stabilizer
,Delta Filter
,CSV Formatter
,Llama 3.2 Vision
,Detections Transformation
- outputs:
Multi-Label Classification Model
,Pixelate Visualization
,Path Deviation
,LMM For Classification
,Keypoint Detection Model
,Gaze Detection
,Line Counter
,Instance Segmentation Model
,CLIP Embedding Model
,Single-Label Classification Model
,Blur Visualization
,Mask Visualization
,Object Detection Model
,Line Counter
,YOLO-World Model
,Model Monitoring Inference Aggregator
,Cache Get
,Polygon Visualization
,Halo Visualization
,Google Vision OCR
,Email Notification
,Model Comparison Visualization
,CogVLM
,Image Threshold
,Keypoint Visualization
,Template Matching
,Image Preprocessing
,Slack Notification
,Roboflow Dataset Upload
,Background Color Visualization
,Bounding Box Visualization
,Label Visualization
,Classification Label Visualization
,Ellipse Visualization
,Line Counter Visualization
,LMM
,Reference Path Visualization
,Stability AI Inpainting
,Dynamic Crop
,Triangle Visualization
,Object Detection Model
,Distance Measurement
,Time in Zone
,Detections Stitch
,Florence-2 Model
,SIFT Comparison
,Keypoint Detection Model
,Corner Visualization
,Perspective Correction
,Local File Sink
,Polygon Zone Visualization
,Twilio SMS Notification
,Trace Visualization
,Webhook Sink
,Detections Consensus
,Size Measurement
,Roboflow Custom Metadata
,OpenAI
,Cache Set
,Instance Segmentation Model
,Crop Visualization
,Roboflow Dataset Upload
,Clip Comparison
,Anthropic Claude
,Image Blur
,Dot Visualization
,Circle Visualization
,Google Gemini
,Segment Anything 2 Model
,Single-Label Classification Model
,Time in Zone
,Florence-2 Model
,Path Deviation
,OpenAI
,Color Visualization
,Multi-Label Classification Model
,Pixel Color Count
,Llama 3.2 Vision
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Email Notification
in version v1
has.
Bindings
-
input
sender_email
(string
): E-mail to be used to send the message.receiver_email
(Union[string
,list_of_values
]): Destination e-mail address.cc_receiver_email
(Union[string
,list_of_values
]): Destination e-mail address.bcc_receiver_email
(Union[string
,list_of_values
]): Destination e-mail address.message_parameters
(*
): References data to be used to construct each and every column.attachments
(Union[bytes
,string
]): Attachments.smtp_server
(string
): Custom SMTP server to be used.sender_email_password
(Union[secret
,string
]): Sender e-mail password be used when authenticating to SMTP server.fire_and_forget
(boolean
): Boolean flag dictating if sink is supposed to be executed in the background, not waiting on status of registration before end of workflow run. UseTrue
if best-effort registration is needed, useFalse
while debugging and if error handling is needed.disable_sink
(boolean
): boolean flag that can be also reference to input - to arbitrarily disable data collection for specific request.cooldown_seconds
(integer
): Number of seconds to wait until follow-up notification can be sent.
-
output
Example JSON definition of step Email Notification
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/email_notification@v1",
"subject": "Workflow alert",
"message": "During last 5 minutes detected {{ $parameters.num_instances }} instances",
"sender_email": "sender@gmail.com",
"receiver_email": "receiver@gmail.com",
"cc_receiver_email": "cc-receiver@gmail.com",
"bcc_receiver_email": "bcc-receiver@gmail.com",
"message_parameters": {
"predictions": "$steps.model.predictions",
"reference": "$inputs.reference_class_names"
},
"message_parameters_operations": {
"predictions": [
{
"property_name": "class_name",
"type": "DetectionsPropertyExtract"
}
]
},
"attachments": {
"report.cvs": "$steps.csv_formatter.csv_content"
},
"smtp_server": "$inputs.smtp_server",
"sender_email_password": "$inputs.email_password",
"smtp_port": 465,
"fire_and_forget": "$inputs.fire_and_forget",
"disable_sink": false,
"cooldown_seconds": "$inputs.cooldown_seconds"
}