The answer to this is that you need use API version 53.0 or higher, and you are missing two fields in the scheduledPath
block at line 35 in your flow.
Yours looks like this:
<scheduledPaths>
<connector>
<targetReference>Your_Flow_Element</targetReference>
</connector>
</scheduledPaths>
But it should look like this:
<scheduledPaths>
<name>AsyncStep</name>
<pathType>AsyncAfterCommit</pathType>
<connector>
<targetReference>Your_Flow_Element</targetReference>
</connector>
</scheduledPaths>
You need to add a name
field (this can be anything you like), and a pathType
variable that needs to be set to "AsyncAfterCommit".
The docs for this are here: FlowScheduledPath Metadata Documentation
If you're interested, this is how I worked this out:
The first error you had is this: Required field is missing: name
So, the easy answer is to add a <name>
field. Since it isn't referenced anywhere else in the file, this can be whatever you like. I set mine to "AsyncStep" like this: <name>AsyncStep</name>
This gets past the first error, but runs into another one:
Following required fields needs to be set for ScheduledPath of type null: TimeSource, OffsetUnit, OffsetNumber
Here, you have two options. If the flow is a scheduled flow, you will set the 3 fields mentioned in the error. However, since yours is an asynchronous flow, you will want to make sure the type is not null.
From here, if you look at the documentation I linked earlier, you will find a field called "pathType", which has the following description:
The type of scheduled path. null
is used for time-triggered and record-triggered paths. The default value is null
AsyncAfterCommit
—The scheduled path runs asynchronously after a save.
So, as you can see, you can add a "pathType" field with a value of "AsyncAfterCommit" like this: <pathType>AsyncAfterCommit</pathType>
.
Note that even if your flow is a record-triggered flow, this scheduled path element is not. It is an async path within that flow.
Adding these two fields will solve your issue as long as your API version is set to at least version 53.0
Hope that helps!
Duncan
sfdx-project.json
?sfdx-project.json
API version to be 53 as thepackage.xml
wouldn't be dictating that. For good measure, you can even pass the api version into your commandsfdx force:mdapi:deploy -d directory --apiversion 53.0 -u targetOrg
. As you noted, the run async feature is presumably the culprit and it specifically is only available at api 53.<pathType>AsyncAfterCommit</pathType>
within the<scheduledPath>
property (new for API 53). It might be worth retrieving again and making sure it's retrieving with API 53 and then deploying as well?