             [lambdacd-value-stream.core :as core]
             [lambdacd.state.internal.pipeline-state-updater :as pipeline-state]
             [clojure.core.async :as async]
-            [lambdacd.core :as lambdacd-core]
             [lambdacd-value-stream.test_utils :refer [some-ctx-with read-channel-or-time-out slurp-chan-with-size map-containing create-temp-dir]]
-            [lambdacd.event-bus :as event-bus]))
+            [lambdacd.event-bus :as event-bus]
+            [lambdacd.execution.core :as execution-core]))
 
 ; SYNTACTIC SUGAR FIRST. SCROLL DOWN FOR TESTS
 


(defn start-wait-for-pipeline-success [state & {:keys [pipeline-to-wait-for] :or {pipeline-to-wait-for :some-pipeline}}]
  (let [wait-for-result-channel (async/go
                                  (let [execute-step-result (lambdacd-core/execute-step {} (:ctx @state)
                                                                                        (fn [args ctx]
                                                                                          (core/wait-for-pipline-success pipeline-to-wait-for ctx)))]
                                    (first (vals (:outputs execute-step-result)))))]
    (swap! state #(assoc % :result-channel wait-for-result-channel))


(defn start-wait-for-upstream-trigger [state]
  (let [wait-for-result-channel (async/go
                                  (let [execute-step-result (execution-core/execute-step {} (:ctx @state)
                                                                                         (fn [args ctx]
                                                                                          (core/wait-for-upstream-trigger args ctx)))]
                                    (first (vals (:outputs execute-step-result)))))]
    (swap! state #(assoc % :result-channel wait-for-result-channel))
