I want a workflow to run each day at 2.00 AM. Is there a way to achieve this? I found many posts but didn't work.
7 Answers
The OOTB way to do this would be to create your workflow as you want it and add a stage at the end. In this stage put in a Pause
action. You can set this for 1 day
(or 24 hours
). For your Transition to stage
, have it redirect back up to the first stage.
The downside of this would be that you have to manually start it that first time. It would also be one continuous workflow rather than it being ran separately once a day.
-
If I pause it for 24 hours, it will load after 24 hours and execute. Will it again pause for 24 hours?– KeerthiCommented Apr 13, 2015 at 19:36
-
Yes, it will keep looping until you cancel the workflow. If you want to test it out, I would suggest doing a 5 minute pause just so you can get a feel of what will happen and see for yourself without having to wait a full day.– JordanCommented Apr 13, 2015 at 19:38
-
I paused it for 1 minute and started the workflow (starts when new item is created). It emailed after 1 minute but it stopped executing after that. The status of workflow changed to completed.– KeerthiCommented Apr 13, 2015 at 19:55
-
Put the pause at the end of the workflow and then point the transition to stage back to the first stage of your workflow. You should get the email right away, then have it pause, then receive another email after a minute.– JordanCommented Apr 13, 2015 at 19:58
-
4As far as I know, this solution will only work in a 2013 workflow. You would have to build your workflow using that platform.– JordanCommented Apr 13, 2015 at 20:16
You can use a task scheduling tool such as SQL Server Agent or Windows Task Scheduler and have that execute a PowerShell script that start the workflow.
And here is a link to run the workflow in powershell: http://www.thesysadminhimself.com/2013/09/sharepoint-start-workflow-all-items-powershell.html
The only other option I can think of is somehow converting your workflow into a timer job but I don't really know how to do that.
..Hope this helps a bit.
Do you mean Sharepoint online (as Sharepoint 2013 online does not exist)? For this task, i would recommand looking into Microsoft Flow that comes with Office 365 and can interact with Sharepoint Online list events and do executions like "wait until". Other solution is Azure webjobs trigger...
https://medium.com/@rjesh/microsoft-flow-pause-till-date-ecec207522d8
I was also looking to schedule my workflow to run at a specific time each day and I ended up solving it this way.
At the very start of the workflow,
1: Set Workflow Variable Set a variable, lets call it "IsToday" to "Current date".
2: Extract Substring of String from Index with Length Start at "0" and the idea is to extract the date only from variable IsToday (not the time). So, to extract 2020-06-09 i need to extract 10 charachters from IsToday, starting at position 0. I put the result in variable "IsTodayDateOnly".
3: Add Time to Date In my case I want the workflow to run at 00:01:00 every day. So I add 1 day and 1 minute to variable "IsTodayDateOnly" and put this in variable "IsTomorrow".
At the end of the workflow,
4: Pause Until Date At the end of your workflow, have it pause until "IsTomorrow" and then direct the workflow to go back to the beginning (Transition to stage) and run again.
I hope this may be of help to others.
You can use PowerShell script. and schedule it with windows task scheduler.
Late to the party, but we use Harepoint Workflow Scheduler for our workflow scheduling needs. It does need to be a 2010 workflow, though, so workflows created using the Harepoint Workflow Designer won't come up (it creates 2013 workflows). If, like me, you've had nothing but trouble getting Sharepoint 2016 and Sharepoint Designer 2013 to talk to each other, you may find you are able to create 2010 workflows without an issue.
I'm using the 'When HTTP request is received' for SharePoint Online An Azure Runbook can be scheduled to trigger this flow.
Downside, you'll need a Premium Power Automate account and an Azure subscription. But you'll get 500 minutes runtime on Runbooks for free.
edit: I just noticed this is a pretty old question. Just my two cents