cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Using Workato for automating processes that require email approval

jeffernst
Deputy Chef I
Deputy Chef I
I use Workato Embedded to build automated Customer Reference Request processes for my customers. Each process/recipe has a step that uses Gmail or Outlook to send an email to the requested customer asking if they'd be willing to take a reference call. I'd like to have it so the customer who receives the email can either approve or reject the request, and based on that response, execute the appropriate next steps in the workflow.
 
Is there a way to build this type of workflow in Workato, to listen for a reply to a previously sent email and take action on it? I imagine that the first email would have to be structured in some way so that we know what responses to listen for, like "Yes" or "No", or have buttons in the email with the response choices? Any advice on how others have handled this is appreciated.
8 REPLIES 8

gary1
Executive Chef III
Executive Chef III

You could also do this with a Webhook recipe. It's a bit easier to set up compared to the API platform.

  1. Create a new recipe with a "Webhook" trigger
  2. Name the event "get_user_response"
  3. Adding an event name will generate a webhook URL, like https://webhooks.workato.com/webhooks/rest/big-long-uuid-here/get_user_response
  4. Set the request type to "GET"
  5. Set a query param for "user_response" -- this will represent the YES or NO from the email
  6. Set another query param for "email_id" -- this is really important because when you receive their response, you need enough context to identify its origin. This means when you send them the email, you need to encode an ID in the link so the webhook can send it back to identify the origin of the response. Otherwise you'd get a bunch of "yes" and "no" responses without having the context of their origin. The ID doesn't need to be an ID in the traditional sense, but something that let's you differentiate one response from the next
  7. Add a logger as step to and add the "user_response" data pill from the trigger
  8. Add another logger with "email_id" data pill
  9. Turn on the recipe or run a test
  10. Open a web browser or terminal and call the webhook URL with the user_response and email_id params, like this: https://webhooks.workato.com/webhooks/rest/big-long-uuid-here/get_user_response?user_response=yes&email_id=12345
  11. The recipe should trigger, parse the params, and step 2 logger should read "yes", and step 3 logger should read "12345". Your browser will show a simple JSON response from the webhook. This can't be controlled (to my knowledge)
  12. Assuming this all worked, you can now update the links in the emails to the webhook URL with different user_response and email_id values. Build out the recipe to do what's needed based on their response.

It's also possible to do this via the API platform, and the benefit might be that you can control the response to the browser, but I'm honestly not sure about that. Hope this helps.

Prudvi
Deputy Chef II
Deputy Chef II

Thanks @gary1 for clear explanation The only reason for API was for security.

gary1
Executive Chef III
Executive Chef III

Even if you used the API platform I think you'd need to encode the access token into the URL to call the endpoint, so security kinda goes out the window.

I can't think really think of a way to protect the endpoint, but you can at least verify the email_id against a list of known IDs to ensure the call is coming from an email recipient before routing to the next recipe/process.

I could be missing something so if you have ideas on how to secure the endpoint using the API platform, please share! 

@gary1  This is awesome. Do you happen to have a sample recipe you could share that has the webhook configured as you described?