CodeCargo logo

Workflows & Self-Service

Building Blocks

Building Blocks is a library of your approved templates, connected to your CodeCargo organization. These templates serve as golden paths - that is, they are approved by your organization as the "right way" to get things done. Building Blocks originate from GitHub repositories and are editable by anyone with the proper GitHub permissions.

Currently Building Blocks supports the following block types:

  • Workflows – GitHub Actions Reusable Workflows
  • Actions – individual GitHub Actions
  • Repository building blocks – an entire repository exposed as a single block, useful for Infrastructure-as-Code (for example, Terraform modules) and other templates. The repository's root README.md is rendered as the block's documentation.

In the future, Building Blocks will also support:

  • GenAI Prompts

What are Building Blocks?

Building Blocks help you:

  • Organize your approved templates in a single location
  • Visualize, edit, and extend them using an AI-powered editor
  • Link them to Projects to provide standardized automations and application stacks to your users

Building Blocks View

The main Building Blocks interface has a tab for each block type (Workflows, Actions, Repositories) plus Sources. Each tab shows its blocks as cards you can search and filter by repository. Each card shows:

  • Name – The workflow, action, or repository name
  • Description – A human-readable summary of what the block does
  • Repository – The source repository the block comes from
  • Version – The branch or tag the block is pinned to, or Latest Release
  • Shared from – For blocks shared by another organization, that organization's alias
The Workflows tab of Building Blocks with cards for Node CI, Java service deploy, Docker publish, Deploy to Kubernetes, Terraform apply and Release from platform-workflows, and CodeQL scan and SBOM and attestation shared from acme-security

Sources

Building Blocks come from sources — GitHub repositories connected via the GitHub App that CodeCargo discovers blocks from. A single source can provide:

  • Workflows – GitHub Actions Reusable Workflows discovered from the repository
  • Actions – GitHub Actions discovered from configured action paths. Each path maps to exactly one action; subdirectories are not searched, so list each action's directory explicitly.
  • A Repository building block – the source repository itself exposed as one block, with its root README.md rendered as documentation

Sources are managed from the Sources tab, where you can add a source, edit its configuration (including its action paths), and remove it. Each source card shows the version it tracks and how many of its discovered blocks are enabled. See Building Block Sources Permissions for who can see and manage sources.

The Sources tab with three connected sources: platform-workflows on main with 6 of 8 workflows enabled, platform-actions at v1.6.0 with 4 of 5 actions enabled, and terraform-aws-service tracking the latest release with its repository block enabled

A repository building block renders the repository's root README.md as its documentation:

The terraform-aws-service repository building block, tracking the latest release, with its README rendered: a usage example for the Terraform module and a table of inputs

Adding a Source

Add a source from the Sources tab (or Add Source when you have none yet):

StepDescription
RepositoryChoose from any repo connected via the GitHub App
VersionTrack a Branch, a Tag, or the Latest Release
Building Block TypesDiscover Workflows, Actions (from the action paths you list), and/or the Repository itself
Configure Building BlocksEnable the discovered blocks you want, optionally with an icon and description

Reusable Workflow

Workflows must follow the GitHub Actions Reusable Workflow specification and the repository that the workflow is defined in must have appropriate permissions. If you do not have appropriate repository permissions set, you will still be able to import the workflow as a Building Block and create Self-Service Workflows; however, they will not execute properly.

Curating Discovered Blocks

When you add a Building Block source, CodeCargo discovers the reusable workflows and actions in that repository. Discovered blocks start disabled, so adding a source by itself leaves the catalog unchanged.

Enable individual workflows and actions on the source, or enable all of them at once. A block appears in the catalog only when both the block and its type on the source (workflows or actions) are enabled. You can also ask Dispatch to add a source and enable its blocks in a single plan.

To change which blocks are enabled later, choose Manage Building Blocks from the source's menu on the Sources tab.

Editing a Building Block

GitHub Actions Workflows that you import as Building Blocks are directly managed by GitHub. This means you can edit them in 3 places:

  1. CodeCargo's GenAI Workflow Editor
  2. GitHub
  3. Your IDE of choice

To edit a workflow in our platform using our GenAI Editor, click on any workflow on the page.

Workflow Editor

The Workflow Editor has a few key features:

  • Visualizer --> visual representation of a GitHub Actions Workflow including triggers, jobs, steps, and configuration
  • Code Editor --> syntax-highlighted editor with schema awareness
  • Preview --> view / accept changes
  • Files --> change which file is present in the Code editor
A matrix job with its strategy, and build-image, a job that calls a reusable workflow
The visualizer for the Java service deploy building block: triggers lead to a Test (Java) matrix job with a strategy of 2 combinations, then build-image, a job that calls the docker-publish reusable workflow, then deploy

Visualizer

  • Toggleable via a tab switcher at the top
  • Presents the workflow as a block-style job and step layout
  • Click into any job or step to view inputs, conditions, or outputs

The visual layout helps non-YAML-native developers and reviewers understand workflow logic and structure.

Matrix Job Visualization

A job with a strategy.matrix is drawn with a Strategy node attached to it:

  • Static matrices (values written out in the YAML) show how many combinations the matrix produces, for example 2 combinations
  • Dynamic matrices (expressions like ${{ fromJSON(inputs.targets) }}) can't be counted until the workflow runs, so the node reads Dynamic matrix

When the visualizer has real run data, as in the CargoWall run visualizer, a matrix job lists each variant that actually ran, with its matrix values in the name.

Reusable Workflow Visualization

The visualizer automatically detects and displays reusable workflows:

  • Job-level reusable workflows appear as special job nodes with a box icon and the workflow reference
  • Workflow inputs and secrets are displayed in expandable sections when present
  • Dependencies show which jobs the reusable workflow depends on
  • Node heights automatically adjust to accommodate the additional workflow information

Reusable workflow jobs display their uses reference prominently, making it easy to identify which external workflows are being called.

Expert Workflow Agent

On the right side of the screen is a context-aware AI agent. This AI agent is purpose-built to be an expert GitHub Actions Workflow agent and is generally capable of the following:

  • Understands the structure and intent of the workflow
  • Can generate or refactor YAML
  • Applies updates to both the code and visualizer in sync
  • Accepts plain language prompts like:
    • “Add a step to cache dependencies”
    • “Change the Node version to 20.x”
    • “Make this reusable for multiple services”
  • The Building Block and the GitHub repository it is stored in is loaded into context

Advanced AI Assistant Use-Cases

Since the AI assistant is purpose-built to be an expert GitHub Actions Workflow agent, it provides powerful tooling that can do the following:

  1. Enhance the security of a workflow
  2. Improve the runtime, efficiency, or cost of running a workflow
  3. Change the core function of a workflow
  4. Convert an Azure DevOps, Jenkins, or other pipeline into a GitHub Actions Workflow
  5. Identify potential errors, security vulnerabilities, or issues that may impact a GitHub Actions Workflow
  6. Apply any of the above changes across multiple workflows defined in a single Git repository

Linking Building Blocks to Projects

Once added to the catalog, Building Blocks can be referenced within Projects. As an example, from within a Project, you can create a Self-Service Workflow (using one of your Building Blocks) that lets your users trigger workflows on-demand. This encourages:

  • Reuse of CI/CD best practices
  • Standardization across teams
  • Easier updates and governance

Building Block Sources Permissions

Access to Building Block sources requires specific permissions:

Sources Tab Visibility

The Sources tab appears only when you have:

  • Permission to list Building Block sources (canListBuildingBlockSources)
  • AND permission to update either workflows (canUpdateBuildingBlockWorkflow) or actions (canUpdateBuildingBlockAction)

Without update permissions for workflows or actions, the Sources tab is hidden since managing Building Blocks requires the ability to modify them.

Source Management Actions

Each source in the sources list has dropdown actions with specific permission requirements:

ActionPermission RequiredDescription
Manage Building BlocksPermission to view the sourceView and configure Building Blocks from this source
Edit SourcePermission to update the sourceModify source configuration and settings
Remove SourcePermission to delete the sourceDelete the source from your Building Blocks

If you don't have any of these permissions, the dropdown menu is hidden entirely.

Permission Hierarchy

To effectively use Building Block sources, you need both source listing permissions and workflow/action update permissions. This ensures users can only access sources they can meaningfully work with.


Cross-Org Building Block Sharing

You can share a building block source with other organizations in your GitHub enterprise, giving those organizations read-only access to the blocks it contains. This lets a central platform team maintain a single source of approved templates that multiple product organizations can consume without duplicating the source repository.

Cross-org Building Block sharing. The provider organization shares a Building Block source through Manage Shares. Each consumer organization sees the source's blocks in its own Building Blocks catalog, labelled with the provider's alias, read-only and pinned to the ref the provider configured. Consumers can browse blocks and use them in Self-Service Workflows but cannot edit them or pick another ref.Provider orgBuilding block sourceGitHub repo, pinnedto its configured refManage SharesAdd or revokeconsumer org aliasesRead-only,pinned refConsumer org ABuilding Blocks catalog+ shared, with provider aliasBrowseUse in SSWsEditConsumer org BBuilding Blocks catalog+ shared, with provider aliasBrowseUse in SSWsEdit

Sharing a Source (Provider Org)

To share a source with another organization:

  1. Navigate to Building Blocks → Sources in your organization.
  2. Open the actions menu for the source you want to share and click Manage Shares.
  3. In the Share Building Blocks dialog, select or type the alias of the consumer organization and click Share.
  4. The organization now appears in the shares list. Repeat for additional organizations.
The Share Building Blocks dialog for platform-workflows, with an organization alias picker, a Share button, and Acme Retail and Acme Labs listed with Remove buttons

To revoke access, open Manage Shares for the source and click Remove next to the organization. Removing the share stops that organization from seeing blocks from the source.

Who can manage shares

Only organization editors with access to the source repository can create or revoke shares. You cannot share a source with your own organization.

Using Shared Blocks (Consumer Org)

When another organization shares a source with yours, its building blocks appear automatically in your Building Blocks catalog alongside your own. Shared blocks display the provider organization's alias so you can identify their origin.

The Repositories tab with Acme Corp's terraform-aws-service block and the terraform-aws-network block shared from acme-security

Consumption is read-only:

  • You can browse, view details, and use shared blocks in Self-Service Workflows.
  • You cannot edit, delete, or modify the source repository or its blocks.
  • The available git ref for a shared block is pinned to the ref configured by the provider; you cannot select an arbitrary branch or tag from the provider's repository.
  • Schema and ref lookups are similarly pinned to the provider's configured ref.

Pairs Well With