Step Configuration

This plugin provides two steps that can be used in conjunction with the plugin’s jobs.

SetTimeZone is used to set the timezone to be used with the currently running job. It is typically run as the second step in a job, immediately following MaxTimestamp. There are no parameters.


AAAPI allows each profile to specify the timezone to use with its data. This means that it is possible for each profile to have a different timezone than the other profiles and a different timezone than used by the Mitto system. Timzone information for each profile is stored in the amazon_advertising.profiles table by the Amazon Advertising: Profiles job.

When exectued in a job, SetTimeZone determines the timzone offset necessary to convert Mitto time to the profile’s timezone. This offset is used when requesting reports for a profile.

MaxTimestamp is a modified version of mitto.iov2.steps#MaxTimestamp. This modified version accepts an optional params parameter that specifies key/value pairs to be used as a filter when selecting the max timestamp.


By default, the plugin uses a per-entity data model, although it also supports a unified data model. Refer to Data Model for more information.

Under the unified model, there is a single amazon_advertising schema with tables containing data for all profiles. When an upsert job is run, it is necessary to determine the max timestamp for the job’s profile id. This accomplished by selecting only timestamps that meet the filter criteria.

As an example, look at the first step of a “Sponsored Brand Report: Ad Groups” job:

    "use": "",
    "column": "run_date",
    "params": {"profile_id": "460027049156373"},

When executed, it will select the maximum value from the run_date column from rows with a profile_id matching "460027049156373". Thus, it selects the maximum run date for the job’s profile id.

This MaxTimestamp exists to support a unified data model, but it is used in all upsert jobs, even those for a per-entity data model, to minimize differences between jobs.