asap

The asap attribute forces the launch in the plan of a workflow instance, disregarding the scheduled start time (at) specified in its workflow definition. It can be applied to run cycles, workflows, and tasks.

Overview

The purpose of the asap attribute is to run the as soon as possible and to be used in parallel with a start time. The asap attribute takes precedence over the start (at) time attribute. If both are defined, workflow instances are launched immediately. If asap is not set, or set to false, workflows use their start time.
Note: Schedule time is the planned start time for workflows and not necessarily their actual start time. It can either be the start time defined in workflow definitions or else the default start time. The schedule time of predecessor tasks is always considered for resolving any dependencies with successor tasks, and it may not be the actual start time in some scenarios.
asap in run cycles

If you set the asap attribute in a run cycle, then the associated workflow instance runs immediately, ignoring the start time specified. Dependencies are resolved according to the schedule time attribute, which corresponds to the start time attribute of run cycles. The run cycle at time has higher priority than the workflow at time, resulting in potential discrepancies between actual and scheduled start times.

In the above scenarios, the start time for a task within the same workflow depends on the start time specified at task level. The task waits until its specified start time. To ignore the start time defined in the task and run it immediately when the workflow starts, set asap to true at task level. In such scenarios, the task runs immediately, overriding the defined start time.

Setting the asap attribute along with a start time helps to resolve dependencies. You can always provide a precise schedule time in advance, even if the actual start time is uncertain due to other dependencies.

Notes:
  • If you are using the Orchestration CLI in schedlang format, you may occasionally encounter definitions containing the keyword TIMEDEP. This means the definition is time dependant and asap is set to false.
  • The default value of the asap attribute changes based on the keyword used to define start time. Using SCHEDTIME sets it to true by default, while using AT time sets it to false by default.

Examples

  1. To create a workflow with asap and start time set in the run cycle, see the following example:
    ---
    kind: JobStream
    def:
      folder: /
      name: WF_WITHATRC
      workstation: /WS_AGT_0
      saturdayIsFree: true
      sundayIsFree: true
      runCycles:
        name: RC1
        type: simple
        freeDaysRule: none
        dates:
        - 2025-01-29
        startTime: 16:00:00
        asap: true
        perJobLatestStart: false
        lateStartAction: doNotRun
      priority: 10
      asap: false
      perJobLatestStart: false
      lateStartAction: doNotRun
      matchingCriteria:
        type: previous
      resourceDependencies: []
      jobs:
        name: JOB1
        workstation: /WS_AGT_0
        jobDefinition:
          type: executable
          task:
            executable:
              virtualType: ByPath
              ByPath: {}
              interactive: false
              environmentVariables: {}
              arguments: []
              path: sleep 1000
          recovery:
            action: STOP
            repeatAffinity: false
        priority: 10
        asap: false
        resourceDependencies: []
  2. To create a workflow with asap set at run cycle level with start time specified at workflow level, see the following example:
    ---
    kind: JobStream
    def:
      folder: /
      name: WF_WITHATWF
      workstation: /WS_AGT_0
      saturdayIsFree: true
      sundayIsFree: true
      runCycles:
        name: RC1
        type: simple
        freeDaysRule: none
        dates:
        - 2025-01-29
        asap: true
        perJobLatestStart: false
        lateStartAction: doNotRun
      priority: 10
      startTime: 18:00:00
      asap: false
      perJobLatestStart: false
      lateStartAction: doNotRun
      matchingCriteria:
        type: previous
      resourceDependencies: []
      jobs:
        name: JOB1
        workstation: /WS_AGT_0
        jobDefinition:
          type: executable
          task:
            executable:
              virtualType: ByPath
              ByPath: {}
              interactive: false
              environmentVariables: {}
              arguments: []
              path: sleep 1000
          recovery:
            action: STOP
            repeatAffinity: false
        priority: 10
        asap: false
        resourceDependencies: []

    Since no start time is specified at run cycle level, the start time specified (18:00:00) at workflow level is taken as the schedule time.