View Source StepFlow.Jobs (StepFlow v1.8.0)

The Jobs context.

Summary

Functions

Returns an %Ecto.Changeset{} for tracking job changes.

Creates a job with a completed status.

Creates a job with an error status.

Creates a job.

Creates a job with a skipped status.

Deletes a Job.

Gets a single job by workflow ID and step ID

Gets a single job by workflow ID and step ID

Gets a single job.

Gets a single job.

Gets a single job with its related status.

Returns the list of jobs pending"

Returns the list of jobs pending"

Returns the list of jobs.

Set skipped status to all queued jobs.

Updates a job.

Functions

Link to this function

abort_jobs(workflow, step_id, action)

View Source
Link to this function

apply_default_query_filters(query, params)

View Source
Link to this function

apply_rights(query, params)

View Source

Returns an %Ecto.Changeset{} for tracking job changes.

Examples

iex> change_job(job)
%Ecto.Changeset{source: %Job{}}
Link to this function

create_completed_job(workflow, step_id, action)

View Source

Creates a job with a completed status.

Examples

iex> create_completed_job(workflow, step_id, "webhook_notification")
{:ok, "completed"}
Link to this function

create_error_job(workflow, step_id, action, description)

View Source

Creates a job with an error status.

Examples

iex> create_error_job(workflow, step_id, "download_http", "unsupported step")
{:ok, "created"}
Link to this function

create_job(attrs \\ %{})

View Source

Creates a job.

Examples

iex> create_job(%{field: value})
{:ok, %Job{}}

iex> create_job(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_paused_job(workflow_id, step_id, step_name, post_action)

View Source

Creates a job with a paused status.

Examples

iex> create_paused_job(workflow, 1, "download_http")
{:ok, "paused"}
Link to this function

create_skipped_job(workflow, step_id, action)

View Source

Creates a job with a skipped status.

Examples

iex> create_skipped_job(workflow, 1, "download_http")
{:ok, "skipped"}

Deletes a Job.

Examples

iex> delete_job(job)
{:ok, %Job{}}

iex> delete_job(job)
{:error, %Ecto.Changeset{}}
Link to this function

filter_status(query, params)

View Source
Link to this function

filter_worker_instance_id(query, params)

View Source
Link to this function

filter_worker_label(query, params)

View Source
Link to this function

filter_worker_version(query, params)

View Source

Gets a single job by workflow ID and step ID

Examples

iex> get_job(123)
%Job{}

iex> get_job(456)
nil

Gets a single job by workflow ID and step ID

Examples

iex> get_job(123)
%Job{}

iex> get_job(456)
nil

Gets a single job.

Examples

iex> get_job(123)
%Job{}

iex> get_job(456)
nil

Gets a single job.

Raises Ecto.NoResultsError if the Job does not exist.

Examples

iex> get_job!(123)
%Job{}

iex> get_job!(456)
** (Ecto.NoResultsError)
Link to this function

get_job_with_status!(id)

View Source

Gets a single job with its related status.

Raises Ecto.NoResultsError if the Job does not exist.

Examples

iex> get_job_with_status!(123)
%Job{}

iex> get_job!(456)
** (Ecto.NoResultsError)
Link to this function

get_pending_jobs_by_type()

View Source

Returns the list of jobs pending"

Link to this function

get_processing_jobs_by_type()

View Source

Returns the list of jobs pending"

Link to this function

internal_list_jobs(params \\ %{})

View Source
Link to this function

list_jobs(params \\ %{})

View Source

Returns the list of jobs.

Examples

iex> list_jobs()
[%Job{}, ...]
Link to this function

skip_jobs(workflow, step_id, action)

View Source

Set skipped status to all queued jobs.

Examples

iex> skip_jobs(workflow, step_id, "download_http")
:ok

Updates a job.

Examples

iex> update_job(job, %{field: new_value})
{:ok, %Job{}}

iex> update_job(job, %{field: bad_value})
{:error, %Ecto.Changeset{}}