Skip to main content
Practitioner ⭐️
August 2, 2024
Solved

10 mintue Scheduled Workflow not working as expected

  • August 2, 2024
  • 12 replies
  • 195 views

I have created 1 workflow , in which I am creating dynamic tasks depending on input, it creates batch of ids and create tasks out of it. Below is workflow definition

WorkflowVersionUpsert(

   workflow_external_id="test_dynamic-0729",

   version="1",

   workflow_definition=WorkflowDefinitionUpsert(

       description="This workflow has two steps",

       tasks=[

           WorkflowTask(

                external_id="test_sub_tasks",

                parameters=FunctionTaskParameters(

                    external_id="test_sub_tasks",

                    data="${workflow.input}"

                ),

                retries=1,

                timeout=3600,

                depends_on=[],

                on_failure = "abortWorkflow",

            ),

           WorkflowTask(

                external_id="test_create_sub",

                parameters=DynamicTaskParameters(

                    tasks="${test_sub_tasks.output.response.tasks}"

                ),

                name="Dynamic Task",

                description="Executes a list of workflow tasks for subscription creation",

                retries=0,

                timeout=3600,

                depends_on=["test_sub_tasks"],

                on_failure = "abortWorkflow",

           )

       ]

   )

Also, I have created function to trigger this workflow. As I want this workflow to fetch new ids and do the required operation, I have scheduled this workflow for 10 minutes. Cron Expression - */10 * * * * 

Issues I am facing:

Workflow schedule is inconsistent. sharing snapshot. No manual trigger was done. 

Impact : As a part of this workflow, I have step to do clean up of staging table at end. Multiple access to same staging table at same time causing failure as tasks are not following schedule and hence, workflow is not able to proceed  further.

Best answer by Jørgen Lund

Hi @Rimmi Anand, you can now use native data workflow triggers rather than a Cognite Function to automate the execution of your workflows. Check out the docs.

 

This should resolve the issue described above, but we’ll follow up on the other related Hub post.

12 replies

Practitioner ⭐️
August 27, 2024

HI @Ivar Stangeby , is there any update on this. Still facing same issue. Tried with different function

  • cluster: westeurope-1, project: slb-uds-dev
  •  function-ID : 673025218246203   
  •  

Jørgen Lund
Expert ⭐️⭐️⭐️⭐️
Product Manager
September 2, 2024

Hi @Rimmi Anand, you can now use native data workflow triggers rather than a Cognite Function to automate the execution of your workflows. Check out the docs.

 

This should resolve the issue described above, but we’ll follow up on the other related Hub post.