       Logger.debug("Run action #{inspect action} #{inspect params}\n #{inspect state, pretty: true}")
     end
 
+    # Logger.debug("Do trigger wait")
     result = Serverboards.Action.trigger_wait(action, params, "rule/#{uuid}")
 
-    Logger.info("Executed action #{inspect action}", rule_uuid: uuid, params: params)
+    # Logger.info("Executed action #{inspect action}", rule_uuid: uuid, params: params)
 
     result = if Enum.count(result)==1 and Map.has_key?(result, :result) do
       result[:result] else result end

  end

  def handle_cast(:continue, %{ running: [] } = state) do
    # Logger.debug("Action chain finished. Final state is #{inspect state.state, pretty: true}")

    # Store the state in the DB
    set_state(state.uuid, state.state)

      running: false,
      signal_end_of_trigger: nil
    }

    # Run next in queue if any
    state = case state.trigger_queue do
      [] ->
        state
      [ {from, params} | rest ] ->
        GenServer.cast(self(), {:trigger, params})
        state = %{ state |
          trigger_queue: rest,
          signal_end_of_trigger: from
        }
        state
    end

    {:noreply, state}
  end
