Branch workflow when data connector returns NULL | Community
Skip to main content
Answered

Branch workflow when data connector returns NULL

  • January 7, 2026
  • 1 reply
  • 126 views

Hello,

I have a data connector whose purpose is to find a custom object by its id. And it can return NULL if it finds nothing.

I would like to branch a workflow depending on whether or not the data connector was successfull in finding the custom object, and it’s not very clear how I can achieve that.

I tried to use the “branch” step with a condition saying that one of the (mandatory) fields of the custom object is “any value” or “is unknown” but that didn’t work. The branch step is behaving like the custom object is always there, even when my endpoint returned NULL. I think the data connector is creating an instance of the custom object in all scenarios.

What could be the proper way to do that?

Best answer by Ebenezer.Laleye

Hi ​@Dev CapCar ! Ebenezer here from Engineering Support👋.

It looks like the workflow is treating the Custom Object as “present” even when your API returns nothing. This usually happens when the Data connector is upserting an empty instance — most often because external_id is mapped from input (like a URL param) instead of the response body.


If external_id is mapped from something that always exists, the connector will create a Custom Object even on an empty/null response. The Branch step then sees that reference and assumes the object exists.

Two reliable ways to branch “found vs not found”

Option 1: Use Success / Fail paths (recommended if possible)

  • Return a 404 when the record isn’t found.

  • Use the connector’s Fail path for “not found” and Success for “found.”

Option 2: Keep 200 responses, but gate object creation

  • Set the Response object path to the object that only exists when found.

  • Map external_id from that response object (not from the request).

  • Update the Conversation/Person reference to the object.

  • Branch on the reference:

    • has any value → found

    • is unknown → not found

Key checks

  • external_id comes from the response body.

  • When the object isn’t found, the response path resolves to nothing (so no instance is created).

  • Branching is based on Success/Fail, the CO reference, or an explicit found flag.

 

1 reply

Forum|alt.badge.img+7
  • Intercom Team
  • Answer
  • January 14, 2026

Hi ​@Dev CapCar ! Ebenezer here from Engineering Support👋.

It looks like the workflow is treating the Custom Object as “present” even when your API returns nothing. This usually happens when the Data connector is upserting an empty instance — most often because external_id is mapped from input (like a URL param) instead of the response body.


If external_id is mapped from something that always exists, the connector will create a Custom Object even on an empty/null response. The Branch step then sees that reference and assumes the object exists.

Two reliable ways to branch “found vs not found”

Option 1: Use Success / Fail paths (recommended if possible)

  • Return a 404 when the record isn’t found.

  • Use the connector’s Fail path for “not found” and Success for “found.”

Option 2: Keep 200 responses, but gate object creation

  • Set the Response object path to the object that only exists when found.

  • Map external_id from that response object (not from the request).

  • Update the Conversation/Person reference to the object.

  • Branch on the reference:

    • has any value → found

    • is unknown → not found

Key checks

  • external_id comes from the response body.

  • When the object isn’t found, the response path resolves to nothing (so no instance is created).

  • Branching is based on Success/Fail, the CO reference, or an explicit found flag.