View Source Lightning.Invocation.Query (Lightning v2.10.4)

Query functions for working with Steps and Dataclips

Summary

Functions

To be used in preloads for workflow > job > step when the presence of any step is all the information we need. As in, "Does this job have any steps?"

By default, the dataclip body is not returned via a query. This query selects the body specifically.

The last step for a job

The last successful step for a job, used in scheduler to enable downstream runs to access a previous run's state

Returns a dataclip formatted for use as an input state.

Steps for a specific user

The last step for a job for a particular exit reason, used in scheduler

Functions

To be used in preloads for workflow > job > step when the presence of any step is all the information we need. As in, "Does this job have any steps?"

By default, the dataclip body is not returned via a query. This query selects the body specifically.

Link to this function

last_n_for_job(job_id, limit)

View Source
@spec last_step_for_job(Lightning.Workflows.Job.t()) :: Ecto.Queryable.t()

The last step for a job

Link to this function

last_successful_step_for_job(job)

View Source
@spec last_successful_step_for_job(Lightning.Workflows.Job.t()) :: Ecto.Queryable.t()

The last successful step for a job, used in scheduler to enable downstream runs to access a previous run's state

Returns a dataclip formatted for use as an input state.

Only http_request dataclips are changed, their body is nested inside a "data" key and request data is added as a "request" key.

Steps for a specific user

Link to this function

steps_with_reason(query, exit_reason)

View Source
@spec steps_with_reason(Ecto.Queryable.t(), String.t()) :: Ecto.Queryable.t()

The last step for a job for a particular exit reason, used in scheduler

Link to this function

wipe_dataclips(query \\ Dataclip)

View Source