Clean scheduled workflow memory

Avatar

Avatar
Validate 1
Level 1
Abraham92
Level 1

Likes

0 likes

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Abraham92
Level 1

Likes

0 likes

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
Abraham92
Level 1

03-06-2020

Hi all,

 

I have a scheduled workflow and sometimes it doesnt give the proper results like I feel it gets stuck with the previous results. For example my workflow has an intersection activity and the intersaction is very simple using email as a key to find the entries and it returns 0 when the 2 inputs are having the same email, or some other times I have a fork which doesnt send the proper results to the 2 outputs so If I stop the workflow and I run it manually it works perfectly fine. At this point I feel like I have to clean the memory after the workflow is completed when it is scheduled so that the next will have empty memory and it will not throw any bad results. Any sugestions to this issue?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
Anita_p
MVP

Likes

119 likes

Total Posts

119 posts

Correct reply

29 solutions
Top badges earned
Contributor
Shape 1
Ignite 3
Ignite 1
Validate 1
View profile

Avatar
Contributor
MVP
Anita_p
MVP

Likes

119 likes

Total Posts

119 posts

Correct reply

29 solutions
Top badges earned
Contributor
Shape 1
Ignite 3
Ignite 1
Validate 1
View profile
Anita_p
MVP

04-06-2020

Hi Abraham,

 

You can write a JS to purge the workflow logs using the workflow id and then start it. 

Follow the below sequence :

  • stop the workflow
  • purge the workflow logs
  • start the workflow

There are predefined js functions to do all the above 3 activities in just one code and you can automate this so it does not require manual effort for clearing the logs.

Frequency you can set once per fortnightly/monthly. 

Multiple recurring workflows on the platform often makes the workflow in a deadlock state with loads of logs.

 

Hope this solution helps.

 

Regards,

Anita

 

Answers (1)

Answers (1)

Avatar

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

88 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

88 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile
Jyoti_Y
MVP

04-06-2020

Hi,

 

Workflow does not store anything once it has finished execution.

It could be possible, your workflow has not finished it's execution before next execution.

Do you have a test activity to check workflow status before proceeding to execution of workflow.

If not, you can follow below steps to avoid workflow running if earlier run has not finished.

1) Define an option - 'isWorkflowRunning'.

2) In workflow, first check value of this option. If it's zero then proceed to execution of workflow activities. If not, then end your execution.

3) After test activity, have a JS, where you will set the value of this option variable as '1', indicating workflow is running.

4) At end of workflow execution, in your end activity, reset option variable value to '0'.

 

Thanks.