0cv/sftools

When trying to Deploy a Flow with One Version receive an error

Closed this issue · 8 comments

Error #1
metadata: unpackaged/package.xml (: NAME OF FLOW)
error: An object 'NAME OF FLOW' of type Flow was named in package.xml, but was not found in zipped directory

0cv commented

Thanks for raising this issue. I tried few things but cannot reproduce it.

  • Is it a legacy flow or a Process Builder?
  • Did you try to delete it or was it a regular deployment (no deletion)?
  • Anything else obvious? and can you reproduce this issue with all the flows you have?

Process builder, I deleted all the versions except the one I needed.

Could it be because I didn't include the flow definition?

0cv commented

Flow Definition is, normally, not needed.

However I see what you mean now. If indeed, a flow is having several versions and you delete all versions but one, the Tree Selector will show the name of the flow without the version number of the flow... And then when you deploy it, it fails of course. It feels like another bug in the Salesforce Metadata API, but I will try to see if there is a way to get the current version number for flows which have only 1 version.

A workaround I found, is to clone the flow, so that at least 2 versions of the same flow exist. Then the Tree Selector displays correctly the name of the flow (with the version appended)...

Thanks.. what a weird bug!

0cv commented

Many weird things with this Metadata API.

So I tested, the Metadata Read / List are failing to retrieve correctly the flow. The Workbench is having also the same issue (Info > Metadata Types & Components > Flow). Only workaround would be to actually retrieve the flows through a wildcard in the package.xml and then read physically the name of the files in the Flow folder... It's an overkill for a relatively edge-case situation so unless someone comes with a PR, I'm not going to implement this in the immediate.

0cv commented

So, another option was to go with the Tooling API, which did the trick ...

So I tried a flow with multi versions, same error

Error #1
metadata: unpackaged/package.xml (: XXX-9)
error: An object 'XXX-9' of type Flow was named in package.xml, but was not found in zipped directory

Error #2
metadata: unpackaged/package.xml (: XXX-8)
error: An object 'XXX-8' of type Flow was named in package.xml, but was not found in zipped directory

Error #3
metadata: unpackaged/package.xml (: XXX-2)
error: An object 'XXX-2' of type Flow was named in package.xml, but was not found in zipped directory

Error #4
metadata: unpackaged/package.xml (: XXX-1)
error: An object 'XXX-1' of type Flow was named in package.xml, but was not found in zipped directory

0cv commented

Thanks, if the label was edited, it was not going to work... Shall be good now, please let me know if you still have issues.