Workflow.Builder workflowBuilder = new Workflow.Builder(jobName);
List<TaskConfig> taskConfigs = Lists.newArrayListWithCapacity(2);
Map<String, String> taskConfigMap =
Maps.newHashMap(ImmutableMap.of("fail", "" + true, "failInstance", "localhost_"
+ START_PORT));
TaskConfig taskConfig1 = new TaskConfig("TaskOne", taskConfigMap, false);
taskConfigs.add(taskConfig1);
workflowBuilder.addTaskConfigs(jobName, taskConfigs);
workflowBuilder.addConfig(jobName, JobConfig.COMMAND, "DummyCommand");
workflowBuilder.addConfig(jobName, JobConfig.MAX_FORCED_REASSIGNMENTS_PER_TASK, ""
+ (NUM_INSTANCES - 1)); // this ensures that every instance gets one chance