                            :onyx.core/catalog catalog
                            :onyx.core/workflow (extensions/read-chunk log :workflow job-id)
                            :onyx.core/flow-conditions flow-conditions
-                           :onyx.core/compiled-pre-fn (compile-pre-task-functions lifecycles (:name task))
-                           :onyx.core/compiled-pre-batch-fn (compile-pre-batch-task-functions lifecycles (:name task))
-                           :onyx.core/compiled-post-batch-fn (compile-post-batch-task-functions lifecycles (:name task))
-                           :onyx.core/compiled-post-fn (compile-post-task-functions lifecycles (:name task))
+                           :onyx.core/compiled-start-task-fn (compile-start-task-functions lifecycles (:name task))
+                           :onyx.core/compiled-before-task-fn (compile-before-task-functions lifecycles (:name task))
+                           :onyx.core/compiled-before-batch-fn (compile-before-batch-task-functions lifecycles (:name task))
+                           :onyx.core/compiled-after-batch-fn (compile-after-batch-task-functions lifecycles (:name task))
+                           :onyx.core/compiled-after-task-fn (compile-after-task-functions lifecycles (:name task))
                            :onyx.core/compiled-norm-fcs (compile-fc-norms flow-conditions (:name task))
                            :onyx.core/compiled-ex-fcs (compile-fc-exs flow-conditions (:name task))
                            :onyx.core/task-map catalog-entry


(defn close-batch-resources [event]
  (let [results (l-ext/close-batch-resources* event)]
    (merge event results ((:onyx.core/compiled-post-batch-fn event) results))))

(defn launch-aux-threads!
  [messenger event outbox-ch seal-ch completion-ch task-kill-ch]

  (stop [component]
    (taoensso.timbre/info (format "[%s] Stopping Task LifeCycle for %s" id (:onyx.core/task (:pipeline-data component))))
    (when-let [event (:pipeline-data component)]
      ((:onyx.core/compiled-after-task-fn event) (l-ext/close-lifecycle-resources* event))

      ;; Ensure task operations are finished before closing peer connections
      (close! (:seal-ch component))
