Skip to main content

Notifications

Dynamics 365 Community / Forums / Field Service forum / I am getting workflow ...
Field Service forum
Suggested answer

I am getting workflow must be in a published state error while creating an agreement.

Posted on by 10

Hi All,

I am getting the above-mentioned error while creating an agreement under Booking setup. Can anyone please advise me what is happening here?

pastedimage1621314532657v1.png

Log File Details:

Exception Message: Workflow must be in Published state.

ErrorCode: -2147220891
HexErrorCode: 0x80040265

ErrorDetails:
ApiExceptionSourceKey: Plugin/Microsoft.Crm.ObjectModel.WorkflowService

ApiDepthKey: 3

ApiPluginSolutionNameKey: System
ApiStepSolutionNameKey: System
ApiExceptionCategory: ClientError
ApiExceptionMesageName: ExecuteUnpublishedWorkflow
ApiExceptionHttpStatusCode: 400
OperationStatus: 0
SubErrorCode: -2146233088
Plugin:
PluginTrace: [Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]


[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]


[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]
[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]

TraceText:
[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]


[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]


[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]
[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]

  • Suggested answer
    dni-dg Profile Picture
    dni-dg 5 on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    Thank you very much Avishesh, this worked for me.

  • Suggested answer
    RE: I am getting workflow must be in a published state error while creating an agreement.

    Hi Satya,

    We had same issue - the error message is confusing in this scenario as all the workflows were active.

    I followed these steps to resolve the issue.

    1. Update Field Service if required

    2. Navigate to Field Service app > Field Service Settings

    3. In "Other tab" of the setting, set "Use enhanced background processing" to "No" - save setting record

    4. Change "Use enhanced background processing" to "Yes" - save setting record.

    I hope this helps.

  • Al Iggs Profile Picture
    Al Iggs on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    I assume that Enhanced Background Processing is disabled? Have you checked if all agreement-related workflows are activated?

    pastedimage1621412269416v1.png

    Can you explain what your custom Flow does?

  • Satya_patoju Profile Picture
    Satya_patoju 10 on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    Hi Alexander Heinze,

    Thank you for suggesting the way to check the failed work flows. I learned a new thing. However, I haven't found any issues with the agreements work flows except a warning.

    pastedimage1621384893406v1.png

    pastedimage1621384982164v2.png

  • Satya_patoju Profile Picture
    Satya_patoju 10 on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    These are the errors from Cloud Flow.

    {

     "error": {

       "code": "0x80040265",

       "message": "Workflow must be in Published state.",

       "@Microsoft.PowerApps.CDS.ErrorDetails.OperationStatus": "0",

       "@Microsoft.PowerApps.CDS.ErrorDetails.SubErrorCode": "-2146233088",

       "@Microsoft.PowerApps.CDS.ErrorDetails.Plugin.PluginTrace": "[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]\r\n\r\n\t\r\n\t[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n\t[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]\r\n\t\r\n\t\t\r\n\t\t[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]\r\n\t\t[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]\r\n\t\t\r\n\t\t\r\n\t",

       "@Microsoft.PowerApps.CDS.TraceText": "\r\n[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]\r\n\r\n\t\r\n\t[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n\t[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]\r\n\t\r\n\t\t\r\n\t\t[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]\r\n\t\t[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]\r\n\t\t\r\n\t\t\r\n\t\r\n",

       "@Microsoft.PowerApps.CDS.InnerError.Message": "Workflow must be in Published state."

     }

    }

  • Satya_patoju Profile Picture
    Satya_patoju 10 on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    Hi Nya,

    If I do deactivate and re-activate the Booking it is working fine. The issue here is I built a power automate flow to create agreements automatically.

    It is throwing the same error in the flow as well.

  • Suggested answer
    Nya Profile Picture
    Nya 29,054 on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    Hi Satya,

    It is recommended to deactivate the records of Booking and Invoice related to the Agreement and re-activate them back.

     pastedimage1621324131517v1.png

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

  • Suggested answer
    Al Iggs Profile Picture
    Al Iggs on at
    RE: I am getting workflow must be in a published state error while creating an agreement.

    Agreements use logic implemented via workflow or Power Automate, your error message indicates that some workflows that have not been activated. Launch the "Solution Health Hub" app and run a "Analysis job for Rule Set: Field Service". This should give you an idea what needs to be fixed.

    Going forward you may consider switching from workflow to Flow. Go to FS>Settings>Other and enable "Use Enhanced Background Processing".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,818 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,147 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans