How to create Workflow Enrollment Trigger from Custom Integration
Hello RevOps community,
I am trying to create a workflow that sends email notifications to customers that have a failed payment on our platform.
We are currently receiving the notice in Hubspot through a custom integration with our application in the Company activity feed (See below screenshot)
Stripe Sync Failure Notice
What we would like to do is create a workflow trigger that enrolls companies when the 'production airbrake app' posts an activity for 'stripe plan syncing failed' notice on the company activity log.
Can I do this out of the box within Hubspot or do I require custom developer assistance?
You can create a workflow based on the associated activity in your screenshot (as I'll describe below) - however it's not ideal, since re-enrollment will not function based on activity property values. At the time of this writing, you cannot make an activity-based workflow, so all workflows that use activities will inherently be cross-object.
What would work better is if some property was updated in HubSpot on payment failure instead of only an activity being associated to the record... so I strongly recommend first going through the property history to see if any property exists denoting a failed payment.
If such a property exists, it would be a much better solution, as it would allow for re-enrollment in your notification workflow, allowing multiple failed payment notifications over time.
Also, just as an FYI: since the activities coming from the app are working correctly - it should be a pretty trivial task for any dev to flip a property in the same function that posts a payment failed activity to HubSpot. Not ideal per your request - but if you go that route, make a enumeration property called "Failed Payment" with values "Yes" and "Previously Failed". I'll include instructions for this alternate workflow below as well.
Creating a Workflow Based on Associated Activities:
Before we start, you should know that triggering workflows based on activities is tricky. This is because "activities" are housed in the "Activity" object, and technically a record of their own. The activity is then associated to a standard company/contact/deal record. (More info on HubSpot Activities)
So, when you trigger a workflow based on activities, it will work - but re-enrollment will not work for activity properties. You could re-enroll based on non-activity properties though. (More Info Here)
Creating the Activity-Based Workflow:
Create a Workflow from scratch, and choose your object: likely Company/Contact (Whichever is record type is being updated with the activity in screenshot above).
Trigger should be "when filter criteria is met".
In the filter criteria at the top of the filter criteria menu, change your object from your starting object to "Activity".
Create filters that include identifying info from the activity - so something like:
"Activity Name" Contains 'Stripe Plan Syncing Failed'. "
Depending on the kind of activity, you may need to use "Note Body" or some other activity property instead of "Activity name". (Default Activity Properties Here)
Keep in mind, this trigger will look for (company/contact/etc) records associated to ANY activity that matches your filters. So be sure to include a few other filters too, such as "Activity Date is after [date of workflow creation]", to make sure you're only enrolling records with fresh failed payment activities. I don't know your portal, but other 'just in case' filters here may help too.
Final Note: I don't think you can use the "Delay Until an Event" action to wait until an additional activity happens, since the activity is cross-object. This may change in the future - and if it does, you can just use a whole string of delay functions copy-pasted, and then you don't need to worry about re-enrollment.
If you do manage to find a property to trigger the workflow instead of an activity:
Create a workflow, trigger on that property.
For example, Company based workflow, "Failed Payment" is any of "Yes".
Enable re-enrollment when "Failed Payment" is any of "Yes".
Perform your actions
Set "Failed Payment" to "Previously Failed" or Clear "Failed Payment".
This method should work with pretty much any property type, though you may need to change it up a bit and re-enroll on "is known" if it's not an enumeration property. Clearing the value at the end will not re-trigger enrollment on "is known".