Test mode does not pass mock data through branching JavaScript step

Hi Celigo Support,

I believe I have found an issue when testing a flow that uses a branching JavaScript step.

In the branching script, I intentionally route a specific record to the first branch based on its ID. For example:

function branching_df09_externalrouting(options) {
  var record = options.record;

  if (record["0"].id === "1267458") {
    return [0];
  }
}

The branching logic itself works correctly. When the flow is enabled and runs normally, the record is routed through the correct branch and the downstream steps receive the data.

However, the issue occurs when I test the flow manually.

Expected behaviour:
The record used in the branching step should be passed to the first downstream step as mock/test data, allowing me to test the remaining steps in that branch.

Actual behaviour:
The branching logic correctly routes the record to branch 1, which is the first branch. However, the first step after the branch receives empty mock data. As a result, I cannot test or troubleshoot the downstream steps.

There appears to be a difference between live execution and test execution:

  • Live flow execution: works correctly
  • Manual testing after the branching step: mock data is empty

Could you please confirm whether this is a known issue or whether there is another way to pass the record through the branch during testing?

image

image

Kind regards,

Nuri Ensing

Hi @nuriensing ,
Thanks for reporting this — I wasn't able to reproduce the issue on my end. Could you share a sample of the record structure you're importing along with any specific settings on the import step — like oneToMany— that might be relevant to the preview behavior? That'll help narrow down what's different in your setup.

I think the branching logic in test mode is broken.

Here is another example using the postResponseMapHook:

In the hook output, the value NS_SalesOrderId is set:

"NS_SalesOrderId": "1203022"

However, in the branching mock data, NS_SalesOrderId appears to be empty:

It looks like the branching test does not receive the updated output from the postResponseMapHook.

[quote="Nuri Ensing, post:3, topic:6392, username:nuriensing"]
1203022
[/quote]

Next, I deliberately changed the branching logic so that the record should be routed to the third branch. However, the record is empty again:

image

The mock record for the first branch still contains the data, even though the branching logic indicates that branch 3 was selected.

It seems that the test-mode mock data is not being updated correctly when the selected branch changes.

Thank you for sharing these details @nuriensing .

I tried to reproduce this on my end. I added a postResponseMap hook on a lookup that injects a hardcoded field into the record, then placed a branch immediately after that step. In the input section of the Branching screen, the hardcoded field showed up as expected — so Branching test input does receive the updated output from the postResponseMap hook.

Looking at your second scenario, where you deliberately changed the branching logic so the record should route to Branch 3, I have a hypothesis about what's happening. I suspect the routing preview on the Branching screen was evaluated against a local edit made in the input on that screen, which is why the output indicated the record would pass through Branch 3. The downstream steps, however, don't consider those local edits — they fall back to the original mock on the export. That would explain why the data still surfaces in the first branch rather than in Branch 3: the two views aren't evaluating against the same record.

If that's the case, it is expected behaviour — but I'd like to confirm that against your exact setup.

Would you be open to a quick call so we can walk through it together? Happy to find a time that works for you.

No there was no local edit made.
Just a quick question: do you have the flow set to "Test" mode? Because if it is Enabled I do not have the problem and the mockup routes through the correct branch.

yes, I have the flow set to "Test" mode. Mock routing should behave consistently in both Test mode and enabled mode. Is this happening in all the flows with branches and consistently reproducible in the account ?

I’m not sure whether this also happens in other flows, as I haven’t been able to reproduce it there. Are you testing this on eu.integrator.io as well?

I was testing on integrator.io.

I have another example in a different environment. The postResponseMap hook output contains the updated values, but these are not reflected in the following branch. The branch input still contains the old data.

Sree, I’ve sent you the flow URL so you can check it directly. I’ve also added you as a user.