For the complete documentation index, see llms.txt. This page is also available as Markdown.

Adding a Conditional Step in a Value Stream

Add conditional logic to the Hello World value stream so outreach runs only for specific form responses.

With the Hello World value stream from the first trail in place, you can add conditional logic to control when a process step runs. In this trail, you send an additional email notification only when the sender provides a specific form response.

You first create a new Make scenario, then apply a condition to the process step in the Hello World value stream.

Creating a new scenario to respond to senders needing outreach

Similar to Setting up a First Value Stream, create a scenario named Send a Survey Feedback that sends another email to form recipients.

1

Create the Hello World Outreach Sent event

In VSM, go to Events -> Event Registry and create a new hello_outreach_sent event named Hello World Outreach Sent.

Hello World Outreach Sent event in Event Registry
Hello World Outreach Sent event in Event Registry
2

Open the Hello World value stream

Go to Value Streams and open the Hello World process you created in the first trail.

3

Create a new scenario process step

Add a new process step and select Create New Scenario. Make opens a scenario template.

Create New Scenario option in the process step
Create New Scenario option in the process step
4

Configure the Trigger Event connection

In the Make scenario, establish the connection in the Trigger Event module.

Trigger Event webhook connection in Make
Trigger Event webhook connection in Make
5

Add the first Set Variable from Process Context module

Add the Set Variable from Process Context module and configure it:

  • Assign the data from the Trigger Event

  • Select the Hello World value stream

  • Use the latest Instance ID as the Example Instance – select the ID from the drop-down list. The ID at the top is from the latest instance

  • Select Hello World Feedback Sent as the Event Type

  • Select email from the Field drop-down list

  • Enter email in the Variable Name field

First Set Variable from Process Context module configuration
First Set Variable from Process Context module configuration
6

Add the second Set Variable from Process Context module

Add a second Set Variable from Process Context module and configure it:

  • Assign the data from the Trigger Event

  • Select the Hello World value stream

  • Use the latest Instance ID as the Example Instance – select the ID from the drop-down list. The ID at the top is from the latest instance

  • Select Hello World Feedback Provided as the Event Type

  • Select forms.0.payload.firstName from the Field drop-down list

  • Enter firstName in the Variable Name field

  • Set Raise Error when Null to Yes

Second Set Variable from Process Context module configuration
Second Set Variable from Process Context module configuration
7

Add the Gmail module

Add the Gmail (Send an Email) module. This trail uses Gmail as the example mail provider, as in Setting up a First Value Stream. You can use any supported provider.

Gmail module in the Make scenario
Gmail module in the Make scenario
8

Configure the Completion Event

In the Completion Event module, select Hello World Outreach Sent as the Event Type.

9

Save and run the scenario once

Save the scenario and select Run once. The scenario should look like this:

Complete Send a Survey Feedback scenario in Make
Complete Send a Survey Feedback scenario in Make
10

Add the scenario to the value stream

In VSM, open the Hello World value stream. Add a new process step with the new scenario. Send a Survey Feedback is visible in the available scenarios list. Select it as the process step.

Send a Survey Feedback scenario added as a process step
Send a Survey Feedback scenario added as a process step
11

Publish and activate the value stream

Select Publish, then confirm the value stream is active.

12

Activate the Make scenarios

Ensure the Send a Survey on Hello World and Send a Survey Feedback scenarios in Make are active.

13

Test the value stream

Re-run the value stream by sending a new trigger event. Use the same Postman request or Celonis Action Flow you used in Setting up a First Value Stream.

After you send the event, you receive an email requesting a form response. After you submit the response, you receive a second email with a thank-you message.

Thank-you email after form submission
Thank-you email after form submission

Applying conditional logic with JSON

Up to this point, the Send a Survey Feedback scenario runs for any form response. Limit the step so it runs only when the response is indifferent or sad. Apply a condition on the Send a Survey Feedback process step in the Hello World value stream.

1

Open the step filter configuration

Go to the Hello World value stream. On the Send a Survey Feedback process step, select Add step filter.

2

Enter the JSON Logic expression

Open the Condition tab. In the JSON Logic Expression field, enter the following expression:

{
    "in": [
        {
            "context": "hello_feedback_provided.forms.0.payload.sentiment"
        },
        [
            "indifferent",
            "sad"
        ]
    ]
}
JSON Logic Expression in the Condition tab
JSON Logic Expression in the Condition tab

The condition maps variables to the relevant fields in your process context.

3

Save the condition

Save the expression as the process step condition and then save the value stream.

4

Publish and activate the value stream

Publish the new version of the value stream and ensure it is active. Only responses with indifferent or sad values run the Send a Survey Feedback step.

The value stream completes regardless of the form response.

5

Test with different form responses

Send the event request again using Postman or Celonis Action Flow. You receive a form submission request again.

  • Submit happy as the response – the Send a Survey Feedback process step does not run.

  • Submit indifferent or sad – the Send a Survey Feedback step runs and you receive another email with the thank-you message and next-step information.

6

Verify the results in the debugger

Open debug mode to verify the value stream behavior. Go to the Hello World value stream and choose the debugger action.

Hello World value stream in debug mode
Hello World value stream in debug mode
  • Happy response – the step was filtered

Filtered step for a happy response
Filtered step for a happy response
  • Indifferent or sad response – the step was invoked

Invoked step for an indifferent or sad response
Invoked step for an indifferent or sad response

You can also use events as conditions on process steps. Multiple events can be assigned to a step or group of steps, and both IN (OR) and AND operators are supported. This is the preferred option when you only need to test for the presence of an event.

Event-based step filter configuration
Event-based step filter configuration

Last updated

Was this helpful?