Create a Daily Schedule for a Flow that Skips Weekends

In this example you create a formula that returns the next schedule date for a flow that's submitted daily on weekdays but not at the weekend.

The formula you create has the following attributes:

  • The formula isn't restricted to a specific legislative data group. It's a global formula for use by any legislative data group.

  • The formula uses the Flow Schedule formula type.

  • The formula doesn't use a context.

  • The formula uses the default SUBMISSION DATE and SCHEDULED DATE as input values.

  • The formula doesn't use any default values for database items.

Create a Fast Formula to Submit a Flow Only on Weekdays

  1. Use the Fast Formulas task to create the formula. Enter these values.

    Field

    Value

    Formula Name

    Daily Weekday Schedule

    Formula Type

    Flow Schedule

    Description

    Submits Flow Daily Except Weekends

    Effective Start Date

    1-Jan-2010

  2. Click Continue.

  3. Enter these formula details in the Formula Text section:

    
    /*******************************************************************
    FORMULA NAME: Daily Weekday Schedule
    FORMULA TYPE: Flow Schedule
    DESCRIPTION:  Formula to return a date time.
                  Returns NEXT_SCHEDULED_DATE;
    FORMULA RESULTS:
     NEXT_SCHEDULED_DATE   This is a date time value with yyyy-MM-dd HH:mm:ss format.
    ********************************************************************/
    /* Inputs  */
    INPUTS ARE SCHEDULED_DATE(DATE)
    
    /* Calculations */
    add =  1  
    day = to_char(SCHEDULED_DATE, 'DAY') 
    if (day = 'FRIDAY') then add = 3 
    NEXT_SCHEDULED_DATE =ADD_DAYS(SCHEDULED_DATE, add)
       
    /* Returns */
    RETURN NEXT_SCHEDULED_DATE
    
    /* End Formula Text */
  4. Click Compile.

  5. Click Save.

Submit the Flow Using the Skip Weekends Formula

The formula is available for use when you submit a flow. For example, if you close your company on weekends, you might schedule the process that loads time entries for your hourly workers so that it runs daily during the week.

  1. Submit the Load Time Card Batches flow from the Payroll Checklist work area.

  2. Enter the parameters for the flow.

  3. Skip the Flow Interaction page.

  4. On the Scheduling page, select the formula from the Frequency field, and enter the dates the schedule starts and ends.

  5. Review and submit the flow.