Example Workflows - Integration with external apps¶
Below you can find example workflows you can use as inspiration to build your apps.
Workflow sending notification to Slack¶
This Workflow illustrates how to send notification to Slack.
Workflow definition
{
"version": "1.4.0",
"inputs": [
{
"type": "WorkflowImage",
"name": "image"
},
{
"type": "WorkflowParameter",
"name": "model_id",
"default_value": "yolov8n-640"
},
{
"type": "WorkflowParameter",
"name": "channel_id"
},
{
"type": "WorkflowParameter",
"name": "slack_token"
}
],
"steps": [
{
"type": "roboflow_core/roboflow_object_detection_model@v2",
"name": "detection",
"image": "$inputs.image",
"model_id": "$inputs.model_id"
},
{
"type": "roboflow_core/slack_notification@v1",
"name": "notification",
"slack_token": "$inputs.slack_token",
"message": "Detected {{ $parameters.predictions }} objects",
"channel": "$inputs.channel_id",
"message_parameters": {
"predictions": "$steps.detection.predictions"
},
"message_parameters_operations": {
"predictions": [
{
"type": "SequenceLength"
}
]
},
"fire_and_forget": false,
"cooldown_seconds": 0,
"cooldown_session_key": "some-unique-key"
}
],
"outputs": [
{
"type": "JsonField",
"name": "status",
"selector": "$steps.notification.error_status"
}
]
}
Workflow sending notification with attachments to Slack¶
This Workflow illustrates how to send notification with attachments to Slack.
Workflow definition
{
"version": "1.4.0",
"inputs": [
{
"type": "WorkflowImage",
"name": "image"
},
{
"type": "WorkflowParameter",
"name": "model_id",
"default_value": "yolov8n-640"
},
{
"type": "WorkflowParameter",
"name": "channel_id"
},
{
"type": "WorkflowParameter",
"name": "slack_token"
}
],
"steps": [
{
"type": "roboflow_core/roboflow_object_detection_model@v2",
"name": "detection",
"image": "$inputs.image",
"model_id": "$inputs.model_id"
},
{
"type": "roboflow_core/property_definition@v1",
"name": "image_serialization",
"data": "$inputs.image",
"operations": [
{
"type": "ConvertImageToJPEG"
}
]
},
{
"type": "roboflow_core/property_definition@v1",
"name": "predictions_serialization",
"data": "$steps.detection.predictions",
"operations": [
{
"type": "DetectionsToDictionary"
},
{
"type": "ConvertDictionaryToJSON"
}
]
},
{
"type": "roboflow_core/slack_notification@v1",
"name": "notification",
"slack_token": "$inputs.slack_token",
"message": "Detected {{ $parameters.predictions }} objects",
"channel": "$inputs.channel_id",
"message_parameters": {
"predictions": "$steps.detection.predictions"
},
"message_parameters_operations": {
"predictions": [
{
"type": "SequenceLength"
}
]
},
"attachments": {
"image.jpg": "$steps.image_serialization.output",
"prediction.json": "$steps.predictions_serialization.output"
},
"fire_and_forget": false,
"cooldown_seconds": 0,
"cooldown_session_key": "some-unique-key"
}
],
"outputs": [
{
"type": "JsonField",
"name": "status",
"selector": "$steps.notification.error_status"
}
]
}
Workflow sending SMS notification with Twilio¶
This Workflow illustrates how to send SMS notification with Twilio.
Workflow definition
{
"version": "1.4.0",
"inputs": [
{
"type": "WorkflowImage",
"name": "image"
},
{
"type": "WorkflowParameter",
"name": "model_id",
"default_value": "yolov8n-640"
},
{
"type": "WorkflowParameter",
"name": "account_sid"
},
{
"type": "WorkflowParameter",
"name": "auth_token"
},
{
"type": "WorkflowParameter",
"name": "sender_number"
},
{
"type": "WorkflowParameter",
"name": "receiver_number"
}
],
"steps": [
{
"type": "roboflow_core/roboflow_object_detection_model@v2",
"name": "detection",
"image": "$inputs.image",
"model_id": "$inputs.model_id"
},
{
"type": "roboflow_core/twilio_sms_notification@v1",
"name": "notification",
"twilio_account_sid": "$inputs.account_sid",
"twilio_auth_token": "$inputs.auth_token",
"message": "Detected {{ $parameters.predictions }} objects",
"sender_number": "$inputs.sender_number",
"receiver_number": "$inputs.receiver_number",
"message_parameters": {
"predictions": "$steps.detection.predictions"
},
"message_parameters_operations": {
"predictions": [
{
"type": "SequenceLength"
}
]
},
"fire_and_forget": false,
"cooldown_seconds": 0,
"cooldown_session_key": "some-unique-key"
}
],
"outputs": [
{
"type": "JsonField",
"name": "status",
"selector": "$steps.notification.error_status"
}
]
}