Skip to main content
Nintex Community Menu Bar
Answer

How can I schedule a workflow to daily in office 365?

  • March 15, 2017
  • 16 replies
  • 72 views

I need to schedule a workflow to daily but I can't see the scheduling option in office 365.

Any help would be appreciated.

Best answer by TomaszPoszytek

In O365 scheduling of site workflows is not available. There are however workarounds (like a workflow with a loop and pause action, that pauses each loop execution for a day), but no such feature OOTB. Please search this forum and you will find a solution.

Regards,

Tomasz

16 replies

TomaszPoszytek
Forum|alt.badge.img+17

In O365 scheduling of site workflows is not available. There are however workarounds (like a workflow with a loop and pause action, that pauses each loop execution for a day), but no such feature OOTB. Please search this forum and you will find a solution.

Regards,

Tomasz


TomaszPoszytek
Forum|alt.badge.img+17

You can as well use 3rd party solution. I can't recall the name at the moment. You will certainly find it searching the forum I'm answering via phone what makes such research a bit difficult

Regards,

Tomasz


  • Author
  • March 15, 2017

Thanks again Tomasz.

I applied the loop and pause action but how can I start manually for the first time? It is a list workflow.


TomaszPoszytek
Forum|alt.badge.img+17

Depending on the UI, page to start workflow manually is differently accessed. Classic vs. Modern:

Regards,

Tomasz


  • Author
  • March 15, 2017

Thanks, however this will start for a specific item. what I want is to start for all the items wherever the condition meets. I wrote a site workflow to start this list workflow using start workflow action but that also ask for specific item id


TomaszPoszytek
Forum|alt.badge.img+17

So to run a workflow on the whole list, you must use site workflow. But again - there will be only one instance of that workflow. I do not understand now what is your case, but.. you cannot run ONE workflow that will affect each item based on condition, in different time. Ok, you can. The site workflow, running in loop, and in each turn querying all list items seeking for those meeting conditions.

Regards,

Tomasz


  • Author
  • March 15, 2017

Actually, I have a list which has multiple rows, each row corresponds to one system. I need a workflow  which runs daily on each row automatically and check its go live date column. If the go live date is due in 7 days or less, it will send the notification.

So, the workflow would be running on each row once in a day. I feel it would be site workflow but then will it run for all the rows?


TomaszPoszytek
Forum|alt.badge.img+17

imho that depends on how you will build it but it's doable


Forum|alt.badge.img+4

Hi,

you can also add a column to your list, ex : WF_Start of type yes/no

Your workflow start on modification with a runif action at top to check if WF_Start is Yes

Then do your work and at the end of your workflow set WF_Start to false

And on a server, you can write a powershell script that update all items of your list in order to set WF_Start to true and schedule it

Regards,

JM


TomaszPoszytek
Forum|alt.badge.img+17

Hehe, there is no "on the server" when speaking about O365 tenant

I mean - not the tenant server. But the script can be hosted on any other server with SharePoint Online PowerShell console

Regards,

Tomasz


Forum|alt.badge.img+4

Sure it's not on the tenant server of course but a server in your organization, or in azur, etc ... and SP Online PowerShell or PowerShell + CSOM, etc

Ex with Powershell + CSOM

$loadInfo1 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
$loadInfo2 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")

$username = ""
$password = ""
$url1="https://xxx.sharepoint.com/"
$bib = "your_bib"

function ActiveWorkflow($adresse) {

    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($adresse)
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $(convertto-securestring $Password -asplaintext -force))

    Try
    {
        $list = $ctx.get_web().get_lists().getByTitle($bib)
        $ctx.Load($list)

        $camlQuery = New-Object Microsoft.SharePoint.Client.CamlQuery
        $camlQuery.ViewXml = '<View><Query><Where><Eq><FieldRef Name="WF_Start" /><Value Type="Integer">0</Value></Eq></Where></Query></View>'
        $items = $list.GetItems($camlQuery)
        $ctx.Load($items)
        $ctx.ExecuteQuery()

        for ($i = 0; $i -lt $items.Count; $i++) {
            $spItem =$list.GetItemById($items[$i].Id)
            $ctx.Load($spItem)
            $ctx.ExecuteQuery()

            $spItem.set_item("WF_Start",1)
            $spItem.update()
            $ctx.ExecuteQuery()
        }
    }
    Catch
    {
      [system.exception]
      $ErrorMessage = $_.Exception.Message
      Write-Host "Erreur dans le traitement : " $ErrorMessage
    }
}

ActiveWorkflow $url1


bamaeric
Forum|alt.badge.img+14
  • Apprentice
  • March 16, 2017

I have used this solution from  with much success: Scheduled Workflows in Office 365


TomaszPoszytek
Forum|alt.badge.img+17

Deewaker have our answers helped you? If so, can you choose one and mark it as "Correct" please?

Regards,

Tomasz


  • Author
  • March 17, 2017

Thanks everyone. It helped a lot.

I created a site workflow with a loop and pause actions. I have a set a date until the workflow will run. The pause action will pause it for 24 hrs so that the logic could execute every 24 hrs. Hence both the problem got resolved.


clavinfernandes
Forum|alt.badge.img+5

vadim_tabakman
Nintex Employee
Forum|alt.badge.img+11
  • Nintex Employee
  • February 22, 2020