---
# System prepended metadata

title: Goal based automations

---

# Goal based automations

## API Changes
- Automations are long lived
- They can have an end or not. If not they will be scheduled indefinitely. 
    - For goals based automation we will not send an end date.
- End date is just the end of scheduling. We will assume scheduler cleans up expired jobs.
- There is one async call back per automation - the call-back from scheduler to run that automation.
- Errors and results are put in the result object of async task. 
- There can be subsequent internal async calls since we'll be doing back end rest calls - but there will be one async task call.
- Automation itself creates a set of goals that is applicable for that run based on the start/end date of the goal
- Stats for successful/unsucessful will be done based on the total set of eligable goals.
- Automations require an "active" status to correspond with the UI target. Inactive (but scheduled) automations should simply escape out.
- Automation start date is when the automation itself is created - the UI will send it (see scheduleStartDate point below)

## UI Changes
- Create/Edit Form - [SOC-2070](https://jira-tech.amobee.com/browse/SOC-2070)
    - Replace single typeahead with list select component for goals. Pass that list of goals to API
    - Change [getGoalStartEndDate](https://bitbucket.amobee.com/projects/SOC/repos/tokyo-ui/browse/src/app/main/goal-automation/goal-automation-detail/goal-automation-detail.component.ts?at=refs%2Fheads%2Fdevelop#162):
        - No longer pass in scheduleEndDate (the automation will run forever)
        - Change how scheduleStartDate is calculated:
            - It should be tomorrow at 1:30 AM in the timezone specified
- Listing Page - [SOC-2069](https://jira-tech.amobee.com/browse/SOC-2069)
    - Remove "Assigned Goal" column from Automations table (it doesn't make sense to show all goals assigned to it since it's more than 1 now)
    - Add partial success value to "Last Executed" column after timestamp: "(X of Y)", where X is successful updates and Y is total attempted updates. Example: 
        - 12/31/2020 01:30 AM GMT-8 (12 of 20)

## New Workaround for automations
1. need new ticket with lots more details