Add practical functions to Events Framework option

  • 4
  • Idea
  • Updated 3 months ago
We are trying to do a massive upgrade to our Renewals Management automation and have been working to use the Events Framework. Our thought was to have an AO that delivers an email with instructions to the customer. Based on them following the instructions, the Renewal Opp is updated to a new stage, which the event is based off of. The customer would then receive an immediate email* confirming our receipt of their action and giving them next steps.

*Here's the problem. Our renewals workflow is best executed using a Source list via a Bionic Query that merges Opportunities (renewal data) & Contacts (email and other specific fields for who receives communication). Unfortunately, Events are based on a trigger installed on a single object (which is Opportunities for us. This results in us not having all the data from the event being triggered. Specifically, we do not have the email of the customer.

My long-winded ask would be to evaluate the power of the Events Framework to be more conducive to combined use with things like Bionic Queries. We have fully integrated our environment to the power of "bionic" and want to add in Events too, but simply cannot at this point.

I would love any ideas people have!
Photo of Ben

Ben, Champion

  • 8,074 Points 5k badge 2x thumb
  • dismayed

Posted 3 months ago

  • 4
Photo of Dan Ahrens

Dan Ahrens, Official Rep

  • 24,802 Points 20k badge 2x thumb
Ben, one possible solution that came to mind is to trigger two events:

First event would be a rule (using event triggering) that copies over relevant information and writes it to custom fields on the Opportunity object. 

Second event would look for the update of the data written in the first step and if complete, triggers the event to kick off the AO using the data on the Opportunity object. 

Would this work?
Photo of Karl Rumelhart

Karl Rumelhart, Official Rep

  • 10,208 Points 10k badge 2x thumb
Terrific and very appropriate use case.  We most definitely need to support enriching events when they arrive, as well as the ability to add additional conditions so an event may or may not lead to a participant.  For now, to take this direction you will need to get the email address in the event.  I am not an expert on Salesforce Triggers but is there any reason you couldn't look up the data from within the trigger using some SOQL?

There is a second direction, which is to keep the follow up action inside the same flow as the original email.  You would need to do the magic inside the Conditional Wait.  Unfortunately, the Event portion of the Conditional Wait is limited to a fixed set of Events based on the previous step.  It would be awesome if we opened this up to custom Events (another great direction!).  For now, you would need to do this with the Calculated Fields capability.  With this, you can check on the Opportunity Status and proceed when it changes.  This applies to your use case except that it won't be real time since the Conditional Wait is polling on a relatively infrequent interval.  (sigh)

So, if you can't make the SOQL work in the Trigger, it looks like I end up where Dan went.  Use the Trigger to kick off a Rule that in turns somehow gets you where you need to be in the process.  Here is an embarrassingly hack-y idea:  in your original flow, send the initial email and then create some unusual CTA followed by a Conditional Wait that listens for the CTA to close.  When the time comes, use an Event to trigger a Rule that closes the CTA and thus moves you past the Conditional Wait to whatever you want to happen when the stage changes. 

To be honest, this is an abuse of the triggered Rule capability -- it is not intended to be used like this.  While the Rule is triggered, it is still a batch process and here we are overloading it for an essentially record-level use case.  Still, if your volumes are low, it would probably work.  Note that if another event occurs while the first is queued up at the Rule, it will be dropped.  So you need to write your Rule to query for all applicable records and handle them at once.