Workflow will not be executed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • webdev
    Junior Member
    • Sep 2023
    • 6

    Workflow will not be executed

    Hello everyone,

    I have created a workflow that is executed after the creation of an invoice, which works so far (workflow 1).

    There is a second workflow that generates an invoice from a sales order (workflow 2). When workflow 2 is triggered, workflow 1 is also executed according to the log, but no changes are made.

    What could be the reason for this?

    Regards
    Tim
  • victor
    Active Community Member
    • Aug 2022
    • 732

    #2
    webdev,
    ​​​​​
    Please provide screenshots of both Workflows (their Conditions and Actions).
    Also, detail what exactly you created these two Workflows for? Do you think these Workflows should interact with each over?

    Comment

    • webdev
      Junior Member
      • Sep 2023
      • 6

      #3
      victor

      screenshots are unfortunately not that easy. i'll try to describe it to you briefly:

      Workflow1:

      - Entity: Invoice
      - Trigger Type: After record created
      - Conditions: no
      - Actions: Execute Formula
      - Works: Works when a new invoice is created (manually) as expected

      Workflow2:

      - Entity: Sales Order
      - Trigger Type: Manual
      - Conditions: no
      - Actions: Creates a new invoice from a sales order

      When I execute workflow 2, I see in the log of workflow 1 that the workflow starts, but the formula is not executed.

      My workaround would be to execute the formula from workflow 1 in workflow 2 as well.

      Do you see another way?

      Comment

      • victor
        Active Community Member
        • Aug 2022
        • 732

        #4
        You explained it quite well, thank you.

        The situation you described is standard and was designed by the developers to avoid looping as much as possible:
        • When you manually click a button in Workflow 2, it executes successfully. This action was taken by the EspoCRM User.
        • However, the Invoice created by Actions of Workflow 2 cannot be a full-fledged trigger for Workflow 1, because this Invoice was not created manually (by the EspoCRM User), but through Workflow 2.

        In order to be able to successfully trigger one workflow due to the actions of another workflow, it is necessary to specify Sequential instead of After record created in the Trigger Type of the workflow that needs to be triggered: https://docs.espocrm.com/administrat...ws/#sequential.

        Or you can use your workaround.
        Last edited by victor; 12-19-2024, 11:04 AM.

        Comment

        • webdev
          Junior Member
          • Sep 2023
          • 6

          #5
          victor thanks a lot! Now it works. I have used workflow\trigger to call the workflow after the invoice is created.

          Comment

          Working...