Treasure Data supports these flexible scheduling options:

  • daily
  • weekly
  • monthly
  • start date
  • end date

When you add a schedule to your workflow, if you attempt to select New Run to run the workflow immediately, you are likely to get an error. The workflow must run at the specified scheduled time.

Set a Daily Schedule

In the following example, the workflow runs every day.

1. Open TD Console
2. Navigate to Data Workbench > Workflows.
3. Open an existing workflow or create a new one.
4. Select Launch Project Editor.

_export:
  td: database:
        workflow_time

  timezone: America/Chicago

  schedule :
        daily>: 07:00:00

Set a Weekly Schedule

In the following example, the workflow runs every Sunday at 09:00.

1. Open TD Console
2. Navigate to Data Workbench > Workflows.
3. Open an existing workflow or create a new one.
4. Select Launch Project Editor.

_export:
  td: database:
        workflow_time

  timezone: America/Chicago

  schedule :
        weekly>: Sun, 09:00:00

Set a Monthly Schedule

In the following example, the workflow runs on the 1st day of every month at 10:00.

1. Open TD Console
2. Navigate to Data Workbench > Workflows.
3. Open an existing workflow or create a new one.
4. Select Launch Project Editor.

_export:
  td: database:
        workflow_time

  timezone: America/Chicago

  schedule :
        Monthly>: 1, 10:00:00

Set a Start Date

In the following example, the workflow run starts on 2022-10-05 and runs daily at 7:00 a.m.

1. Open TD Console
2. Navigate to Data Workbench > Workflows.
3. Open an existing workflow or create a new one.
4. Select Launch Project Editor.

_export:
  td: database:
        workflow_time

  timezone: America/Chicago

  schedule :
     start>: 2022-10-05
     daily>: 07:00:00

Set a Start and End Date

Setting an end date can help you to end campaign workflows on a set schedule, so there is no accidental running of a workflow after the completion of a campaign.

How End Dates Work

  • The workflow scheduler stops scheduling the workflow past YYYY-MM-DD.  
  • The time for the end schedule always defaults to "end date HH:MM:SS"; the user-defined date and not exceeding "end date 23:59:59".

Example 1

In the following example, the first schedule runs the workflow daily from 7:00 a.m until 2022-10-04. The second schedule starts on 2022-10-05, run hourly at HH:50:15, and ends on 2022-10-10 at 23:50:150

1. Open TD Console
2. Navigate to Data Workbench > Workflows.
3. Open an existing workflow or create a new one.
4. Select Launch Project Editor.

_export:
  td: database:
        workflow_time

  timezone: America/Los Angeles

schedule:
  daily>: 07:00:00  
  end>: 2022-10-05 

schedule:
start>:2022-10-05 
 Hourly>: 50:15 
 end>:2022-10-10


Example 2

In the following example:

  • The schedule starts from 2022-10-05 runs daily at 7:00 am until 2022-10-10.
  • The second schedule runs using the following schedule: Starts on 2022-10-05 at 11:30 a.m. and then runs hourly at HH:50:15 until 2022-10-10 23:50:15
    • 1st run: 2022-10-05 at 11:30 am
    • 2nd run: 2022-10-05 at 11:50:15 am
    • 3rd run: 2022-10-05 at 12:50:15 pm
    • and so on
1. Open TD Console
2. Navigate to Data Workbench > Workflows.
3. Open an existing workflow or create a new one.
4. Select Launch Project Editor.

_export:
  td: database:
        workflow_time

  timezone: America/Chicago  

  schedule:
  	start>: 2022-10-05T10:00:00
  	daily>: 07:00:00  
    end>: 2022-10-05 


  schedule:
    start>: 2022-10-05T11:30:00 
    Hourly>: 50:15
    end>: 2022-10-10
  • No labels