I'm running into a strange issue with my Record-Triggered Flow in Salesforce.
Basically, whenever a record is created or updated in Salesforce, we want to send a message to an external API. The problem is that only created records are running successfully in the Flow, updated records don't run. We see a message saying
The triggering record didn’t meet the condition requirements, so the flow didn’t run
There's a chain of issues resulting from using the HTTP Callout that led to this. The first is that they can't be under the Run Immediately path, otherwise we get this error.
A record-triggered flow can’t execute actions that make external callouts in a path that runs immediately.
So we created another scheduled path, with the Time Source being "When Record is Created or Updated" with the Time Source set to 0, so it will run immediately.
But this gives us another issue, in that the path requires Entry Conditions, we get this error if we try to set the Condition Requirements to "None":
This flow has a scheduled path with a time source based on when a record is created or updated. Configure the flow to run only when a record is updated to meet the condition requirements.
So we set up a Condition Requirement, something that would always be true, like "Id is not null", and set the Flow to run "Every time a record is updated and meets the condition requirements". But then we get this error trying to save it:
This flow has a scheduled path with a time source based on when a record is created or updated. Configure the flow to run only when a record is updated to meet the condition requirements.
Finally, we set the Flow to run "Only when a record is updated to meet the condition requirements".
But that leads us to our problem, in that the flow will only run if the Entry Conditions change from not meeting the requirements, to meeting the requirements. Ex: it will only run if the Id on the record changed from null to not null.
So updates aren't running because the Id field isn't changing. But due to the limitations of the HTTP Callout, I can't see any way around these restrictions to make the Flow run every single time. Is there a way around this? Or an Entry Condition I can set up that would fix this?
The flow is designed to trigger only when a record is updated and the condition requirements change. However, your requirement is to have the flow execute on every update, regardless of whether the condition requirements change.
A possible solution would be to use a formula field on the record that changes each time the record is updated (see "Tips for Referencing Record Types in Formulas"). That field could be a timestamp or a counter that increments on each update. That way, the flow's condition will always be met, triggering the HTTP Callout.
For example, you could create a formula field named
LastModifiedDateFormula
with the following formula:True: the Salesforce Record-Triggered Flow is designed to execute only when the conditions change from not being met to being met. If the condition is based on a field (
LastModifiedDateFormula
) that is always non-null, the flow might not trigger as intended because the condition does not change from false to true.Given this limitation, consider instead a timestamp comparison.
Create two timestamp fields:
LastModifiedDateFormula
: That remains as a formula field with the formulaTEXT(LastModifiedDate)
.PreviousUpdateTimestamp
: That is a new DateTime field that stores the timestamp of the previous update.The flow's condition would check if
LastModifiedDateFormula
is different fromPreviousUpdateTimestamp
. If they are different, it indicates that the record has been updated.After the HTTP Callout action, add an action to update
PreviousUpdateTimestamp
with the currentLastModifiedDate
value. That makes sure on the next update, the condition will be re-evaluated correctly.