Skip to main content

AWS CodeBuild ExecModule

Overview

AwsCodeBuildModule brings bounded AWS CodeBuild project discovery, build-history inspection, build-detail reads, and exact run controls into ValkyrAI workflows. Release, incident, and platform workflows can identify a project, inspect current or historical build state, start a reviewed revision, stop one exact running build, or retry a known build without accepting arbitrary buildspec or environment-variable overrides.

The connector implements eight operations:

  • list_projects and batch_get_projects discover project identity and safe configuration summaries.
  • list_builds, list_builds_for_project, and batch_get_builds retrieve bounded build identifiers and normalized build state.
  • start_build starts one exact project, optionally at a reviewed source revision and with a provider idempotency token.
  • stop_build attempts to stop one exact build after explicit confirmation.
  • retry_build restarts one exact build after explicit confirmation and may use a provider idempotency token.

n8n's reusable AWS credential model is the functional workflow reference: region and AWS identity belong in a reusable credential rather than ordinary node input. ValkyrAI follows its native IntegrationAccount contract and adds operation-specific field allowlists, project/build identity validation, bounded pagination, raw-credential rejection, read-only retries, single-attempt mutations, confidential output classification, and deterministic receipts.

Usage

  1. Identify the AWS account, region, CodeBuild projects, and build controls a workflow may use.
  2. Create a least-privilege AWS principal with only the required CodeBuild actions and project resource conditions.
  3. Store its access key ID and secret access key in an AWS IntegrationAccount; verify it and keep it in READY status.
  4. Add AwsCodeBuildModule and bind the account through ExecModuleConfig.authConfig.integrationAccount.
  5. Use list_projects and batch_get_projects to reconcile the exact project before accepting a project name from another workflow step.
  6. Use list_builds_for_project followed by batch_get_builds to inspect current status and retain the AWS request ID.
  7. Require a reviewed source revision and an explicit confirmation before start_build.
  8. Read the exact build immediately before and after stop_build or retry_build so ambiguous outcomes are reconciled instead of blindly replayed.

Never put access keys, secret keys, session tokens, credential objects, buildspec text, registry credentials, certificates, or environment-variable overrides in module input. Raw credential-shaped fields and every undocumented override fail before network access. Treat project source locations, IAM roles, artifact locations, commit identifiers, build initiators, logs, and failure state as confidential workflow data.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNoneOne of the eight documented operations.
regionstringEvery executionNoneValid AWS region such as us-west-2.
nextTokenstringOptional list fieldNoneOpaque provider token, at most 4,096 characters.
limitintegerList operations100Total bound from 1 through 1,000.
returnAllbooleanList operationsfalseFollow pages until limit, provider exhaustion, or 100 pages.
sortBystringlist_projectsNAMENAME, CREATED_TIME, or LAST_MODIFIED_TIME.
sortOrderstringList operationsDESCENDINGASCENDING or DESCENDING.
projectNamestringProject-scoped list/start or singular batch readNoneExact 2-255 character CodeBuild project name.
projectNamesarraybatch_get_projectsNoneOne through 100 distinct exact project names.
buildIdstringStop/retry or singular batch readNoneExact CodeBuild build ID, at most 512 characters.
buildIdsarraybatch_get_buildsNoneOne through 100 distinct exact build IDs.
sourceVersionstringOptional start_build fieldProject defaultReviewed source revision, at most 512 characters.
idempotencyTokenstringOptional start/retry fieldNoneUp to 64 letters, digits, ., _, or -; retain it for reconciliation.
confirmStartBuildbooleanstart_buildfalseMust be exactly true.
confirmStopBuildbooleanstop_buildfalseMust be exactly true.
confirmRetryBuildbooleanretry_buildfalseMust be exactly true.

projectName and projectNames are mutually exclusive. buildId and buildIds are mutually exclusive. Batch reads remove duplicate identifiers while preserving caller order. Unexpected fields fail before provider access, which deliberately prevents hidden buildspec, artifact, cache, compute, environment-variable, service-role, certificate, registry-credential, and privileged-mode overrides.

Outputs

Every call returns stable status, operation, and attempts fields.

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation.
attemptsintegerAlwaysProvider calls including pages and retry-safe reads.
resultTypestringSuccessProject name, project, build ID, build, or build-control family.
itemsarrayList or batch-read successBounded normalized project or build results.
countintegerItems presentNumber of returned items.
pagesintegerPaginated successProvider pages consumed.
hasMorebooleanPaginated successWhether AWS returned another token.
nextTokenstringAnother page existsOpaque continuation token.
dataobjectBatch or run-control successNot-found identifiers or normalized mutation receipt.
requestIdstringAWS supplies oneBounded provider reference for reconciliation.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

Project summaries include bounded identity, description, role, source, buildspec path, environment image/compute type, artifact configuration, timeouts, timestamps, encryption key, concurrency limit, and badge state. Environment-variable values, registry credentials, source authorization, certificate material, and webhook secrets are omitted.

Build summaries include identity, project, status, phase, source revisions, initiator, timestamps, completion, safe artifact checksums/location, log links, and bounded phase timing. They omit environment variables, source credentials, debug-session details, exported variables, provider error messages, and arbitrary build output.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

FieldRequirement
ProviderAmazon Web Services / CodeBuild
statusMust be READY.
verifiedMust be true.
apiKey SecureFieldAWS access key ID.
password SecureFieldAWS secret access key.

Grant only actions used by the reviewed workflow:

  • Project discovery: codebuild:ListProjects and codebuild:BatchGetProjects.
  • Build reads: codebuild:ListBuilds, codebuild:ListBuildsForProject, and codebuild:BatchGetBuilds.
  • Run controls: codebuild:StartBuild, codebuild:StopBuild, and/or codebuild:RetryBuild only for explicitly governed projects.

Use IAM project ARNs, resource tags, permissions boundaries, organization service-control policies, and separate read/run accounts to reduce blast radius. Prefer a read-only account unless build control is an explicit requirement. Starting a build also exercises the CodeBuild project's service role; reviewing the caller policy alone does not establish the build's downstream permissions.

Configuration

The awsAccount relationship is the only credential configuration. Operation, project/build identity, pagination, source revision, idempotency token, and safety confirmations belong in mapped input or module parameters.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-codebuild-release"
},
"payloadConfig": {
"parameters": "{\"operation\":\"start_build\",\"region\":\"us-west-2\"}"
}
}

The relationship value is illustrative. Persisted workflows bind the generated IntegrationAccount relationship, never plaintext credentials.

Operations

OperationProvider behaviorSide effect and retry behavior
list_projectsLists bounded project names with selected sort order.Read-only; each page retries transient failures.
batch_get_projectsReads safe summaries for up to 100 exact project names and reports names not found.Read-only; bounded retry.
list_buildsLists bounded build IDs across the account/region.Read-only; each page retries transient failures.
list_builds_for_projectLists bounded build IDs for one exact project.Read-only; each page retries transient failures.
batch_get_buildsReads normalized details for up to 100 exact build IDs and reports IDs not found.Read-only; bounded retry.
start_buildStarts one exact project, optionally at a reviewed source revision.Confirmed external mutation; exactly one attempt.
stop_buildAttempts to stop one exact running build.Confirmed destructive mutation; exactly one attempt.
retry_buildRestarts one exact build.Confirmed external mutation; exactly one attempt.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing/malformed region, project, build, list, bound, token, or confirmation; or an undocumented override.NoCorrect the named input; no AWS request was sent.
UNSUPPORTED_OPERATIONUnknown operation.NoSelect a documented operation.
INTEGRATION_ACCOUNT_ERRORAccount missing, unverified, not READY, or missing key material.NoRepair and bind the AWS account.
AWS_CODEBUILD_HTTP_400Invalid project/build, incompatible source revision, completed stop target, or provider input conflict.Usually noInspect current project/build state and request ID.
AWS_CODEBUILD_HTTP_403IAM, SCP, resource-tag, service-role, KMS, source, artifact, log, or VPC policy denied the request.NoGrant only the missing action or revise the governed workflow.
AWS_CODEBUILD_HTTP_404Exact project or build is absent.NoReconcile current region, project name, and build ID.
AWS_CODEBUILD_HTTP_429 / 500 / 503Throttle or transient provider pressure.Reads retry; writes remain single-attemptReconcile project/build state before mutation replay.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Reads retry; writes report ambiguityTreat mutation acceptance as unknown until build state is read.
EXECUTION_ERRORUnexpected bounded runtime failure.No automatic replayPreserve operation and request evidence for investigation.

Provider exception messages are never copied into workflow output. This prevents credentials, project topology, source details, commit identifiers, artifact paths, IAM roles, and build state from leaking through failures.

Example

Start one reviewed release build:

{
"operation": "start_build",
"region": "us-west-2",
"projectName": "valkyrai-release",
"sourceVersion": "refs/heads/rc-7",
"idempotencyToken": "release-20260908-1900",
"confirmStartBuild": true
}

Expected result shape:

{
"status": "success",
"operation": "start_build",
"attempts": 1,
"resultType": "build_control",
"data": {
"accepted": true,
"action": "start",
"build": {
"id": "valkyrai-release:provider-build-reference",
"projectName": "valkyrai-release",
"status": "IN_PROGRESS",
"sourceVersion": "refs/heads/rc-7",
"currentPhase": "SUBMITTED"
}
},
"requestId": "aws-request-reference"
}

Use the returned exact build ID with batch_get_builds until the workflow reaches a terminal state. Do not treat a successful start response as proof that source checkout, commands, artifacts, reports, or deployment succeeded.

Notes

  • Pagination: list operations accept an opaque nextToken; all loops stop at limit, provider exhaustion, or 100 pages. CodeBuild list APIs may return up to 100 identifiers per provider page.
  • Batch limits: project and build detail reads accept at most 100 distinct identifiers. Not-found identifiers are returned separately from successful normalized items.
  • Rate limits: AWS SDK internal retries are disabled. ValkyrAI applies bounded backoff only to read operations and honors ExecModule retry attempts from 1 through 5.
  • Idempotency: reads are retry-safe. start_build and retry_build may carry a caller-owned provider idempotency token, but ValkyrAI still issues each mutation once. Preserve the same token during reconciliation; do not change inputs under a reused token.
  • Destructive behavior: stop_build attempts to end one exact running build and can interrupt tests, artifacts, reports, and deployment steps. It requires confirmStopBuild: true; always inspect the exact build first.
  • Secret safety: the module does not accept buildspec, environment-variable, compute, image, registry, certificate, cache, artifact, log, service-role, privileged-mode, or debug-session overrides. Manage those settings in the governed CodeBuild project.
  • Build outcomes: start/retry acceptance is not build success. Follow the exact build ID and terminal status; use CloudWatch Logs, reports, artifacts, and deployment evidence through separately authorized workflows.
  • Source versions: sourceVersion is passed to CodeBuild as a bounded opaque revision. Validate branch, tag, pull-request, or commit conventions in the approval workflow before confirmation.
  • Deferred scope: project create/update/delete, webhooks, batch builds, report/test-case retrieval, caches, fleets, sandboxes, source credentials, resource policies, and arbitrary build overrides are intentionally excluded.
  • External verification: repository tests use a deterministic transport and make no AWS call. Provider behavior requires a separately authorized least-privilege AWS account and reviewed project/build scope.