Chapter 5. Workflow Applications

We learned about action types, the basic building blocks of an Oozie workflow, in the last chapter. In this chapter, we will get into the various aspects of authoring a complete workflow application comprised of those actions. We will learn all the tricks and techniques, like parameterization and variable substitution, that come in handy when assembling actions into a functional workflow. We will also see how to manage and drive the control flow among those actions.

Outline of a Basic Workflow

As we have already seen, workflows are defined in an XML file that is typically named workflow.xml. Example 5-1 shows an outline of a typical Oozie workflow XML, which captures some of the relevant components and the most common sections.

Example 5-1. Outline of a basic workflow
<workflow-app xmlns="uri:oozie:workflow:0.5" name="simpleWF">
  <global>
      ...
  </global>
  <start to="echoA"/>
  <action name="echoA">
    <shell xmlns="uri:oozie:shell-action:0.2">
      ...
    </shell>
    <ok to="echoB"/>
    <error to="done"/>
  </action>
  <action name="echoB">
    <shell xmlns="uri:oozie:shell-action:0.2">
      ...
    </shell>
    <ok to="done"/>
    <error to="done"/>
</action>
  <end name="done"/>
</workflow-app>

At the very beginning of the XML is the <workflow-app> root element with an xmlns and a name attribute specifying the name of the workflow application.

Tip

Oozie performs XML schema validation on all XML files used to define workflows, coordinators, and bundles. So you must specify a schema URI (the xmlns attribute ...

Get Apache Oozie now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.