Notifying Respondents
Since web inputs are created by a user and typically request a response from a different user, flows does not email respondents itself notifying them that web inputs are awaiting their response (to avoid undesirable and unsolicited email blasts from globus).
This page demonstrates how a flow author could implement custom automatic email notifications using their own email credentials alongside the builtin web input functionality.
Example Flow
The following flow will create a web input, notify its respondent using SMTP credentials, then wait for a response.
This flow assumes a Globus group of approving sysadmins exists with UUID
aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee and can be reached at
sysadmins@university.edu. It holds placeholder values for a false SMTP server
at smtp.university.edu with sending email automations@university.edu.
To use this yourself, replace these values with your own valid ones. See
Action Provider: Send Notification Email
for more specifics on using the notify action provider.
{
"StartAt": "CreateApprovalRequest",
"States": {
"CreateApprovalRequest": {
"Comment": "Create a web input.",
"Type": "CreateWebInput",
"Parameters": {
"InputType": "Selection",
"Options": [
{
"Value": "approve",
"Label": "Approve"
},
{
"Value": "deny",
"Label": "Deny"
}
],
"Context": {
"Title": "Approval Required",
"PresentationStyle": "Text",
"Text": "A flow run requires your approval before it can continue."
},
"RespondentUrns": [
"urn:globus:groups:id:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
]
},
"ResultPath": "$.create_result",
"Next": "NotifyRespondents"
},
"NotifyRespondents": {
"Comment": "Email respondents, notifying them of an awaiting response.",
"Type": "Action",
"ActionUrl": "https://actions.globus.org/notification/notify",
"Parameters": {
"body_mimetype": "text/plain",
"body.=": "'A flow run requires your approval.\n\nVisit the Globus Web App at https://app.globus.org/flows/web-inputs/' + $.create_result.web_input_id + ' to respond.'",
"destination": "sysadmins@university.edu",
"subject": "Action required: flow run awaiting your approval",
"sender": "automations@university.edu",
"__Private_Parameters": [
"send_credentials"
],
"send_credentials": [
{
"credential_type": "smtp",
"credential_value": {
"hostname": "smtp.university.edu",
"username": "email@.university.edu",
"password": "password_or_api_key",
"port": 587
}
}
]
},
"ResultPath": "$.notify_result",
"Next": "WaitForApproval"
},
"WaitForApproval": {
"Comment": "Wait for a response to the web input.",
"Type": "AwaitWebInput",
"Parameters": {
"WebInputId.$": "$.create_result.web_input_id"
},
"ResultPath": "$.await_result",
"End": true
}
}
}