#228 new
Greg Schueler

three-phase workflow for jobs (pre post conditions)

Reported by Greg Schueler | March 11th, 2011 @ 03:32 PM

Add Workflow prepare/finish phases

A Workflow should change to have 3 "phases":

  1. prepare
  2. run
  3. finish

The current "workflow/sequence" will be the "run" phase.

The behavior when executing a job/workflow will be as follows:

  1. Execute the "prepare" phase, on the server node only.
    • if this phase exits without a successful result (non-zero exit value) then:
      • The entire Job finishes with the result state: "prepare-not-successful"
    • Otherwise, continue to the next phase.
  2. Execute the "run" phase, as the workflow currently executes dispatched across nodes.
    • retain the execution result of this phase for input to the next phase
    • continue to the next phase
  3. Execute the "finish" phase, on the server node only. It allows a new expansion token "run.result" containing either 0 (success) or non-zero (failure) result of phase 2.
    • if this phase exits successfully, then the Job result status is set to the result status of phase 2
    • if this phase exits non-zero (failed), then Job result status is set to: "finish-not-successful"

document definitions

the xml/yaml formats would have to be changed to support the 2 new phases. currently they have:

xml: <command.../>...

        - item1...

For XML: add subsections to the <sequence>, and migrate the existing <command> elements into a <run> element...

<sequence ... >
        <command .../>
        <command .../>
        <command .../>
        <command .../>
        <command .../>
        <command .../>

For YAML: replace the "commands:" section with "run:" and add "prepare:" and "finish: " sections:

            - item1 ..
            - item2...
            - item1...
            - item2...
            - item1...
            - item2...


The web GUI for Job edit/create will have to change to support the new phases. The GUI should indicate their semantics with text, and reinforce their place as secondary to the main workflow sequence for basic use cases.

By default for a new Job the Prepare/Finish would be shown as secondary to the Run phase, perhaps with some kind of disclosure button to show the full section if they are empty. Otherwise the GUI widgets would be the same as for current workflow editor.


keepgoing: False
Strategy: Node-oriented

Prepare phase: [+] Click to add. *All items must succeed for the workflow to continue*

Run: *Main workflow steps*
    1. ...
    2. ...

Finish: [+] Click to add. *Allows verification of Run results*

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues

Shared Ticket Bins

People watching this ticket


Referenced by