web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

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

(1) ShareShare
ReportReport
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]

I have the same question (0)
  • Suggested answer
    Al Iggs Profile Picture
    on at

    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".

  • Suggested answer
    Nya Profile Picture
    29,060 on at

    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

  • Satya_patoju Profile Picture
    10 on at

    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.

  • Satya_patoju Profile Picture
    10 on at

    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
    10 on at

    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

  • Al Iggs Profile Picture
    on at

    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?

  • Suggested answer
    Avishesh Shrestha Profile Picture
    50 on at

    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.

  • Suggested answer
    dni-dg Profile Picture
    5 on at

    Thank you very much Avishesh, this worked for me.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans