Querying Task (Electron) Status in a Notebook#

Check the status of individual tasks in a workflow using the Covalent Result object.


Define and run a workflow:

import covalent as ct

import time

def add(x, y):
    return x + y

def multiply(x, y):
    return x * y

def workflow(x, y):
    res_1 = add(x=x, y=y)
    return multiply(x=res_1, y=y)
  1. View the transport graph in the Covalent GUI as described in the User Interface Reference to determine the node IDs for the electrons.

  2. Query the individual electrons’ execution status using the node IDs from the transport graph.

dispatch_id = ct.dispatch(workflow)(x=1, y=2)
result = ct.get_result(dispatch_id=dispatch_id, wait=False)

Note the query for the execution status via the status field. Possible values are PENDING, FAILED, RUNNING, or COMPLETED. A node can also have status NEW_OBJECT if the task has not yet been been put in a queue for execution.

See Also#

Adding Electrons to Lattices

Dispatching a Workflow

Querying the Status of a Lattice