Pipelines (SDK)
Create, trigger, and inspect Microtica pipelines and builds with the SDK's pipelines namespace, including the combined history timeline.
The pipelines namespace manages your pipelines and their builds, and exposes a combined timeline of every build and deployment in a project.
Every method takes a project id as its first argument.
Methods
| Method | Returns |
|---|---|
pipelines.list(projectId, opts?) | Pipelines in the project. |
pipelines.get(projectId, pipelineId) | One pipeline, fully populated. |
pipelines.create(projectId, request) | The new pipeline's id. |
pipelines.update(projectId, pipelineId, request) | Update a pipeline. |
pipelines.updateSpec(projectId, pipelineId, microticaYaml) | Replace the inline microtica.yaml. |
pipelines.delete(projectId, pipelineId) | Delete a pipeline. |
pipelines.trigger(projectId, pipelineId, opts) | Start a build; returns the build id. |
pipelines.history(projectId, opts?) | Combined builds-and-deployments timeline. |
pipelines.listBuilds(projectId, pipelineId, opts?) | Builds of one pipeline. |
pipelines.getBuild(projectId, pipelineId, buildId, startDate?) | One build, with steps and spec inline. |
pipelines.buildLogs(projectId, pipelineId, buildId, opts?) | A build log stream. |
list and listBuilds strip heavy fields (microticaYaml, schema, readme, kubeConfig) and convert timestamps to ISO-8601 by default. Pass { full: true } to keep the raw shape. The same trimming is available as the exported slimPipeline and slimBuildDetails helpers.
Create and trigger
const { pipelineId } = await microtica.pipelines.create(projectId, {
name: "my-app",
repositoryUrl: "https://github.com/acme/my-app",
gitAccountId,
branchFilter: "^(main|develop)$",
automatedTrigger: true,
});Trigger a build with a Git ref. Pass a fully-qualified ref such as refs/heads/main:
const { buildId } = await microtica.pipelines.trigger(projectId, pipelineId, {
ref: "refs/heads/main",
environmentVariableOverrides: [{ key: "NODE_ENV", value: "staging", sensitive: false }],
});Then stream the build with buildLogs.
Combined history
history returns a project-wide, correlated timeline of builds and deployments — one entry per logical run — with rich filters.
const { pipelines, total, hasMore } = await microtica.pipelines.history(projectId, {
envIds: ["prod"],
types: ["deploy"],
from: Date.now() - 24 * 60 * 60_000,
limit: 50,
});PipelineHistoryOptions accepts from, to, envIds, repoNames, resourceName, kubernetesId, appName, types ("deploy" | "build" | "buildonly" | "template"), includeEvents, limit (default 50, max 500), and offset.