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 thewhere
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, statusfrom circleci_workflowwhere pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e'order by created_at desc;
select id, created_at, statusfrom circleci_workflowwhere 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_secondsfrom circleci_workflowwhere pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e';
select id, project_slug, strftime('%s', stopped_at) - strftime('%s', created_at) as duration_in_secondsfrom circleci_workflowwhere pipeline_id = 'f43cc52a-c7eb-4a72-a05f-399c8577bb3e';
Schema for circleci_workflow
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
canceled_by | text | ID of the user who canceled the workflow. | |
created_at | timestamp with time zone | Timestamp of when workflow was created. | |
errored_by | text | ID of the user who caused the workflow to error. | |
id | text | Unique key for the workflow. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the account login. |
name | text | Human readable name of the workflow. | |
pipeline_id | text | = | Unique key for the pipeline. |
pipeline_number | bigint | A second identifier for the pipeline. | |
project_slug | text | A unique identification for the project in the form of: <vcs_type>/<org_name>/<repo_name>. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
started_by | text | Id of the user who started the workflow. | |
status | text | Workflow status. | |
stopped_at | timestamp with time zone | Timestamp 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