Question

Photo of Matt Rouse

0

Workflow Trigger By Text

Is it possible to have a workflow trigger on something other than a save or delete? For example, I want a workflow to trigger whenever a text message is sent or received. I've tried all kinds of different things, but it doesn't seem to work. Any ideas?

Thanks!
Matt

  • Photo of Jeremy Turgeon

    1

    Hi Matt,

    This is a great question but will be a little bit tricky to implement.  The first thing to note is that Workflow Triggers don't save or delete anything.  They simple 'interrupt' an existing save or delete and then run a workflow at that point.  There's too much information on this for one post so check out Blasting Off With Workflows for all the details.

    Now on to solving your problem.  The first thing you'll need is the ID of your communication medium (SMS).  In this example it is 38 but you can check in SQL to find yours if it's different.  To do this within Rock, go to Admin Tools > Power Tools > SQL Command.  Be warned.  A lot of damage can be done to your system from the SQL command so back up your system before messing with it.  Run the following statement to find all of your communication IDs (should only be 2)

    SELECT *

    FROM Communication

     

    Find a message that you know is from your SMS medium and grab its Medium Entity Type Id.  This is the value you'll need in your trigger.  Now go to Workflow Triggers and create a trigger with this information.  Here's a sample with 38 as the Medium Id.

     

    wft.PNG

     

    Select an existing workflow that you want run everytime an SMS is sent or recieved and you're set.  I haven't had a chance to test this out yet so let me know if you run into any issues.

     

    Hope that helps!

     

  • Photo of Matt Rouse

    0

    Thanks so much Jeremy! That was very helpful! Any idea if it's possible to pass information from the text message into an attribute in the workflow?