function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
d1c3m4nd1c3m4n 

Migration tool workflow errors

 

Was wondering if anyone has come across a similar issue before...

 

Getting the following errors when trying to do a full deployment using the migration tool.

 

Error: workflows/PersonAccount.workflow(PersonAccount):Cannot create workflow directly; must create the CustomObject first

---> This is odd because it's a full deployment which means the object is there, but for some reason the error exists. In addition, there's no visible Person Account-specific workflow component in the org itself for a metadata component to be generated.

 

Error: workflows/Question.workflow(Question):Cannot create workflow directly; must create the CustomObject first

Error: workflows/Reply.workflow(Reply):Cannot create workflow directly; must create the CustomObject first

---> Best guess for these two is that they are related to the installation of the Timba app which some folks are trying out. Having said that, I've already uninstalled the app in the source org, but the *.workflow metadata components are still there. I even tried physically removing the metadata in both the IDE and yet when I do a refresh from the server, they both come back.

 

Appreciate any insights you can offer on these errors.

Hopefully someone has encountered them before and can let me know how they were able to get rid of them.

Last resort is of course doing a clean-up of the metadata after a 'retrieve' task and prior to the 'deploy',

but I'd rather find the root cause and fix it properly.

 

Thanks in advance!

 

JimmyK12JimmyK12

I've come across this same issue - I'm using Ant and when I do a retrieve from one of my sandbox orgs the directory that comes back includes workflows for Question, Reply and SocialPost - all of which are not enabled. When I attempt to deploy  I receive the "cannot create workflow..." error you described. 

 

Error: workflows/Question.workflow(Question):Cannot create workflow directly; must create the CustomObject first
Error: workflows/Reply.workflow(Reply):Cannot create workflow directly; must create the CustomObject first
Error: workflows/SocialPost.workflow(SocialPost):Cannot create workflow directly; must create the CustomObject first

 

These workflows, however, are NOT included in the extracted directory when I do the same retrieve call from my production org. The only solution I can think of is to manually spcify which workflows need to be included in the package.xml used in the extraction instead of just using * - which is tedious, and seems ridiculous because the objects arent active in the sandbox.

 

Has anyone experienced this? Possibly solved it?

 



jdillonjdillon

I have not solved this problem, but I created a workaround.  In my ant script that does a deploy, I call a cleanup task first that deletes these files before doing the deploy.  If the thought of deleting them worries you, you can filter them out when copying to a stage area or zip file.