turbot/circleci
steampipe plugin install circleci

Table: circleci_workflow - Query CircleCI Workflows using SQL

CircleCI is a Continuous Integration and Continuous Deployment (CI/CD) platform that automates the build, test, and deployment of applications. A CircleCI Workflow is a set of rules for defining a collection of jobs and their run order. Workflows manage the jobs that you have defined in your configuration and the order in which they run.

Table Usage Guide

The circleci_workflow table provides insights into Workflows within CircleCI. As an engineer or developer, explore workflow-specific details through this table, including status, project details, pipeline information, and more. Utilize it to uncover information about workflows, such as those with failed jobs, the run order of jobs within a workflow, and the overall status of workflows.

Important Notes

  • You must specify pipeline_id in the where clause to query this table.

Examples

Workflow status of a pipeline

Explore the status history of a specific pipeline to understand its progression over time. This can be useful in identifying patterns or issues in the pipeline's workflow.

select
id,
created_at,
status
from
circleci_workflow
where
pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e'
order by
created_at desc;
select
id,
created_at,
status
from
circleci_workflow
where
pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e'
order by
created_at desc;

Workflow duration of a pipeline

Analyze the duration of a specific pipeline's workflow in CircleCI. This can be useful in assessing the efficiency of the pipeline, identifying potential areas for optimization.

select
id,
project_slug,
extract(
seconds
from
(stopped_at - created_at)
) as duration_in_seconds
from
circleci_workflow
where
pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e';
select
id,
project_slug,
strftime('%s', stopped_at) - strftime('%s', created_at) as duration_in_seconds
from
circleci_workflow
where
pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e';

Schema for circleci_workflow

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
canceled_bytextID of the user who canceled the workflow.
created_attimestamp with time zoneTimestamp of when workflow was created.
errored_bytextID of the user who caused the workflow to error.
idtextUnique key for the workflow.
nametextHuman readable name of the workflow.
pipeline_idtext=Unique key for the pipeline.
pipeline_numberbigintA second identifier for the pipeline.
project_slugtextA unique identification for the project in the form of: <vcs_type>/<org_name>/<repo_name>.
started_bytextId of the user who started the workflow.
statustextWorkflow status.
stopped_attimestamp with time zoneTimestamp of when workflow was stopped.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- circleci

You can pass the configuration to the command with the --config argument:

steampipe_export_circleci --config '<your_config>' circleci_workflow