   end
 
   def publish_status_event(state) do
-    workload = if state[:workload] == nil do
+    workload = Agent.get(HeartbeatWorkload, fn workload -> workload end)
+    workload = if workload == nil do
       []
     else
-      state[:workload]
+      workload
     end
 
     Publisher.publish_event(%StatusEvent{

      workload: workload
    })    
  end

  @doc """
  GenServer callback for handling the :set_workflow event.  This method
  will store the current worklow into the server's state.

  {:noreply, state}
  """
  @spec handle_call({:set_workload, List}, term, Map) :: {:reply, :ok, Map}
  def handle_call({:set_workload, workload}, _from, state) do
    {:reply, :ok, Map.put(state, :workload, workload)}
  end
end
        if Application.get_env(:openaperture_overseer_api, :autostart, true) do
          GenServer.cast(pid, {:publish})
        end

        Agent.start_link(fn -> [] end, name: HeartbeatWorkload)
        {:ok, pid}
      {:error, reason} -> {:error, reason}
    end
