Apination workflow is a configuration of steps Apination system must execute to run a user scenario

Workflow Steps

Each workflow step is defined as { action: { /* action configuration */ } }, for example:

{
  get_weather_forecast: {
    date: '2016-07-19T00:00:00.000Z',
    location: 'San Diego, CA'
  }
}

Naming

Each step must have an unique name. If name is not defined explicitly, it will be generated automatically (e.g. get_weather_forecast_0)

Data References

Each step parameter can be substituted from any previusly processed step output:

{
  upload_forecast_to_ftp: {
    forecast: '$get_weather_forecast_0.data' 
  }
}

Given get_weather_forecast is already executed and has data attribute in output, the data attribute value will be put to the forecast field automatically.

The default step input name is input, if it’s not defined explicitly, it will be generated automatically as '$' + previous_step_name + '.data', e.g.:

[
  {
    get_weather_forecast: {
      name: 'GET_FORECAST',
      date: '2016-07-19T00:00:00.000Z',
      location: 'San Diego, CA'
    }
  },
  {
    upload_forecast_to_ftp: {
      // assigned automatically at runner creation
      input: '$GET_FORECAST.data'   
    }
  }
]

Parallel

Workflow sequences can be executed in parallel:

{
  parallel: [
    // first sequence
    [
      { get: { /* ... */ } },
      { filter: { /* ... */ } },
      { map: { /* ... */ } }
    ],
    // second sequence
    [
      { do_something_different: { /* ... */ } }
    ]
  ]
}

For-Each

forEach instructions allows to execute multiple worklfows in parallel for data retrieved at runtime:

{
  forEach: {
    input: '$previous_step.batch_output',
    do: [
      {
        do_something_with_object: { /* ... */ }
      }
    ]
  }
}

Such construction will issue an index-stream step first and will expect a ‘stepComplete’ event in the following format:

{
  type: 'stepComplete',
  name: 'forEach_0',
  data: 'http://indexed_stream',
  stats: {
    indexes: [[2,100],[103,100]]
  }
}

For each input source listed in the data, a copy of workflow sequence defined in do will be created and executed in parallel.