              :choices :any
              :tags [:fault-tolerance]
              :restrictions ["Must resolve to a function on the classpath at runtime."]
-             :optional? true}
+             :optional? true
+             :added "0.8.0"}
 
             :onyx/params
             {:doc "A vector of keys to obtain from the task map, and inject into the parameters of the function defined in :onyx/fn."
              :type :vector
              :tags [:function]
-             :optional? true}
+             :optional? true
+             :added "0.8.0"}
 
             :onyx/medium
             {:doc "Denotes the kind of input or output communication or storage that is being read from or written to (e.g. `:kafka` or `:web-socket`). This is currently does not affect any functionality, and is reserved for the future."

             :default true
             :tags [:aggregation :windows]
             :optionally-allowed-when ["A window is defined on this task."]
             :required-when ["A Window is defined on this task and there is no possible :onyx/uniqueness-key to on the segment to deduplicate with."]}}}

   :flow-conditions-entry
   {:summary "Flow conditions are used for isolating logic about whether or not segments should pass through different tasks in a workflow, and support a rich degree of composition with runtime parameterization."

            {:doc "The name of a `:window/id` window to fire the trigger against."
             :type :keyword
             :optional? false
             :restrictions ["Must name a `:window/id` in the window entries."]
             :added "0.8.0"}

            :trigger/refinement
            {:doc "The refinement mode to use when firing the trigger against a window. When set to `:accumulating`, the window contents remain. When set to `:discarding`, the window contents are destroyed, resetting the window to the initial aggregation value. The initial value is set lazily so expired windows do not unnecessarily consume memory."
             :type :keyword
             :choices [:accumulating :discarding]
             :optional? false
             :added "0.8.0"}

            :trigger/on
            {:doc "The event to trigger in reaction to, such as a segment with a special feature, or on a timer. See the User Guide for the full list of prepackaged Triggers."
             :type :keyword
             :optional? false
             :added "0.8.0"}

            :trigger/sync
            {:doc "A fully qualified, namespaced keyword pointing to a function on the classpath at runtime. This function takes the window contents as its argument. Its return value is ignored. This function is invoked when the trigger fires, and is used to do any arbitrary action with the window contents, such as sync them to a database."
             :type :keyword
             :optional? false
             :added "0.8.0"}

            :trigger/period
            {:doc "A timer trigger sleeps for a duration of `:trigger/period`. When it is done sleeping, the `:trigger/sync` function is invoked with its usual arguments. The trigger goes back to sleep and repeats itself."
             :type :keyword
             :required-when ["`:trigger/on` is `:timer`"]
             :choices [:milliseconds :seconds :minutes :hours :days]
             :optional? true
             :added "0.8.0"}

            :trigger/threshold
            {:doc "A segment trigger will fire every threshold of segments."
             :required-when ["`:trigger/on` is `:segments`"]
             :type [:integer :elements]
             :example [5 :elements]
             :optional? true
             :added "0.8.0"}

            :trigger/fire-all-extents?
            {:doc "When set to `true`, if any particular extent fires in reaction to this trigger, all extents also fire."
             :type :boolean
             :optional? true
             :default false
             :added "0.8.0"}

            :trigger/doc
            {:doc "A docstring for this trigger."
             :type :string
             :optional? true
             :added "0.8.0"}}}

   :lifecycle-entry
   {:summary "Lifecycles are a feature that allow you to control code that executes at particular points during task execution on each peer. Lifecycles are data driven and composable."
