Skip to main content
All CollectionsHow-tosArticles
Example Approach: Event Timers
Example Approach: Event Timers

In this article we'll explore an approach to implementing PROMPTs and buffering a conditional trigger

Yanni Hajioannou avatar
Written by Yanni Hajioannou
Updated over a week ago

Intro

With workflow automations, there will come a time when we will need a user to interact in the middle of a story. This could be for a review process, validating a user's actions, or whichever other reason you'd want a user to interact. In these scenarios, the PROMPT function can come in handy.

In some scenarios, we may want to have a time-sensitive response. For instance, if there is a login from a different IP address associated with an IT admin for our company, we may want to take some kind of precaution. They could have left their laptop unlocked at a cafe, and some hacker got a hold of it!!! Possible panic ensues, but let's create some kind of buffer before we assume the worst.

At first, we may send an email or notification to that user to confirm that it is really them. We don't want to be too hasty, so let's create a delay before temporarily cutting off the user's access to critical administrative systems.

How can you test a PROMPT?

Prompts in Tines allow for user interaction within your automation. By testing a prompt, you can see how users engage with the automation—whether they click a link, respond to a question, or trigger an action. This testing phase is critical to ensure the prompt works as intended.

Press Play/Pause to follow along with the GIF below

Example steps:

  1. Add a PROMPT function within an action (+ and then value)

    1. In this example, it is within a Send Email action

  2. Set text after the prompt as PROMPT("Yes")

  3. Hover on the bottom right where it says Result and copy the URL

  4. Paste that URL into a browser window to emulate someone "clicking" the link

  5. There will be a new event payload, go into the event data to review it

  6. You can also emulate this by having the action run and, in the email, clicking on the link

  7. Review the results of the event data

    1. Notice how there is a "status" object that we can reference

How do you apply error handling to a PROMPT?

Whenever using PROMPTs, it is good to put in a trigger to have that validation if it is clicked. If we don't have this in, the story will continue regardless of whether the prompt is clicked. Since the PROMPT allows us to have a feedback loop with some external source, we want to ensure that we have a small check right after the action with the prompt.

Press Play/Pause to follow along with the GIF below

Example steps:

  1. Drag a trigger action into your story

  2. Connect from the previous action

  3. Set the name of the trigger

    1. In this example I call it "Was clicked?"

  4. Click into the data pill for "somekey.subkey.subkey.goal"

  5. Set this to the JSON path of the "status" object

  6. Change the text "foo" to "Yes"

    1. This is the condition that we are looking to see if the user clicked on the link. When the user clicks the link that "status" text is the one we set earlier. This could also be things like "acknowledge, yes, no" or whatever you want the text to be.

  7. Set text after the prompt as PROMPT("Yes")

  8. Go to the previous action and re-emit the event payload with the status to make sure your trigger works as intended

  9. Review the results of the trigger

How do you remove duplicates from a PROMPT flow?

To maintain the efficiency and accuracy of your story flow, it’s essential to remove duplicate submissions. Deduplication helps to prevent repetitive actions and ensures that your automation only processes unique data entries.

Press Play/Pause to follow along with the GIF below

Where should you apply a delay with event timers?

After the trigger condition isn't met, we can add in a buffer so the user has an opportunity to click on the link. In a real world example they aren't going to have 0 seconds to click on something before action is taken.

In our example we'll do a shorter span delay with seconds, but we can always bump that number up as we are developing stories for production.

Press Play/Pause to follow along with the GIF below

How do you know the PROMPT flow works correctly?

Whenever you have situational logic that relies on a user interacting / not interacting with something - it's good to do a final check. In this quick video we'll see what happens if the user clicks the email and then how the delay event data flows/spots at the dedup.

Press Play/Pause to follow along with the GIF below

Did this answer your question?