Create

  • POST
  • /workspaces
  • /:domain
  • /projects
  • /:project_name
  • /pipelines

Creates a new pipeline in the project.

Event schema

Here's how to define the event triggering the pipeline:

Event schema
"events": [ { "type": "PUSH", "refs": [ "refs/heads/main", "refs/heads/dev-*" ] }, { "type": "PULL_REQUEST", "events": [ "assigned", "unassigned", ], "branches": [ "main", "relesaes/*" ] }, { "type": "SCHEDULE", "start_date": "2025-01-01T08:00:00.000Z", "delay": 60, "refs": [ "refs/heads/development" ] } ]

Trigger condition schema

You can define trigger conditions in the following way:

Trigger condition schema
{ "trigger_conditions": [ { "trigger_condition": "VAR_IS", "trigger_variable_key": "myVar", "trigger_variable_value": "expectedValue" }, { "trigger_condition": "OR", "trigger_operands": [ { "trigger_condition": "ON_CHANGE" }, { "trigger_condition": "VAR_IS_NOT", "trigger_variable_key": "otherVar", "trigger_variable_value": "someValue" } ] } ] }

Request

REQUIRED SCOPES
WORKSPACE, EXECUTION_MANAGE
URL PARAMETERS
domainrequired string
The workspace domain.
project_namerequired string
The name ID of the project.
POST PARAMETERS
namerequired string
The name of the pipeline.
refsstring[]
Refs for manual pipeline triggers; if unset and Events is empty, the pipeline counts as codeless.
eventsEvent[]
The list of events for which the pipeline will be triggered.
trigger_conditionsTriggerCondition[]
The list of trigger conditions to meet so that the pipeline can be triggered. Default operator for multiple conditions is AND if you want to use OR it has to be added.
always_from_scratchboolean
Defines whether or not to upload everything from scratch on every execution.
auto_clear_cacheboolean
Defines whether or not to automatically clear cache before running the pipeline.
no_skip_to_most_recentboolean
Defines whether or not to skip execution to the most recent execution.
do_not_create_commit_statusboolean
Defines whether or not to omit sending commit statuses to Github or Gitlab upon execution.
pausedboolean
Defines if the recurrent pipeline executions are paused or not. Restricted to SCHEDULE event.
ignore_fail_on_project_statusboolean
If set to true the status of a given pipeline will not impact the project status on the dashboard.
execution_message_templatestring
The title of every execution in this pipeline. By default, it is set to $BUDDY_RUN_COMMIT_SUBJECT.
target_site_urlstring
The URL of the target website.
disabledboolean
Set it, if you want the pipeline to be disabled.
disabled_reasonstring
Specifies the reason for disabling the pipeline.
variablesVariable[]
List of variables defined for that pipeline.
concurrent_pipeline_runsboolean
Defines whether or not the pipeline can be run concurrently.
fetch_all_refsboolean
When the pipeline is run, Buddy fetches only one Git reference to the pipeline filesystem (branch, tag, or pull request). If the option is set to 'true', Buddy will be forced to fetch all Git references.
permissionsPipelinePermissions
Define to set permissions for the pipeline.
git_changeset_basestring
Defines the way the changeset for deployments and trigger conditions between subsequent executions in the pipeline will be calculated. Available values: LATEST_RUN, LATEST_RUN_MATCHING_REF, PULL_REQUEST. By default, it is set to LATEST_RUN.
filesystem_changeset_basestring
Defines changeset calculation method whenever deployment action has input_type set to BUILD_ARTIFACTS. Default set to DATE_MODIFIED. Possible values: DATE_MODIFIED, CONTENTS.
cache_scopestringBETA
Docker cache scope. Available values: WORKSPACE, PROJECT, PIPELINE. By default, it is set to PIPELINE.
description_requiredBoolean
The default value is false. If set to true and the user does not provide a description when starting a pipeline, the pipeline won't run.
pause_on_repeated_failuresInteger
Pauses the pipeline after n failed pipeline runs. Restricted to pipelines set SCHEDULEevent. Possible values: 1-100 (the default value is 100).
git_config_refString
Information where the pipeline configuration should be stores. Available values: NONE, DYNAMIC, FIXED. By default, it's NONE.
git_configPipelineGitConfig
Set if git_config_ref = FIXED. Contains information about where the pipeline configuration is stored.

Last modified on Feb 6, 2025

Example:

curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/pipelines" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "name": "Tests",
  "events": [
    {
      "type": "PUSH",
      "refs": [
        "refs/heads/main",
        "refs/heads/dev-*"
      ]
    },
    {
      "type": "PULL_REQUEST",
      "events": [
        "assigned",
        "unassigned"
      ],
      "branches": [
        "main",
        "relesaes/*"
      ]
    },
    {
      "type": "SCHEDULE",
      "start_date": "2025-01-01T08:00:00.000Z",
      "delay": 60,
      "refs": [
        "refs/heads/development"
      ]
    }
  ],
  "variables": [
    {
      "key": "my_var",
      "value": "some_value"
    }
  ],
  "execution_message_template": "test",
  "always_from_scratch": true,
  "auto_clear_cache": true,
  "no_skip_to_most_recent": true,
  "do_not_create_commit_status": true,
  "ignore_fail_on_project_status": true,
  "filesystem_changeset_base": "CONTENTS",
  "concurrent_pipeline_runs": true,
  "git_changeset_base": "LATEST_RUN_MATCHING_REF",
  "permissions": {
    "others": "DENIED",
    "users": [
      {
        "id": 1,
        "access_level": "READ_WRITE"
      }
    ],
    "groups": [
      {
        "id": 1,
        "access_level": "READ_ONLY"
      }
    ]
  }
}'
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2", "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2", "id": 2, "name": "Tests", "events": [ { "type": "PUSH", "refs": [ "refs/heads/main", "refs/heads/dev-*" ] }, { "type": "PULL_REQUEST", "events": [ "assigned", "unassigned" ], "branches": [ "main", "releases/*" ] }, { "type": "SCHEDULE", "start_date": "2025-01-01T08:00:00.000Z", "delay": 60, "refs": [ "refs/heads/development" ] } ], "variables": [ { "url": "https://api.buddy.works/workspaces/buddytest/variables/1", "type": "VAR", "id": 1, "key": "my_var", "value": "some_value", "encrypted": false } ], "execution_message_template": "test", "last_execution_status": "INITIAL", "last_execution_revision": null, "create_date": "2016-03-29T07:12:30.675Z", "always_from_scratch": true, "auto_clear_cache": true, "no_skip_to_most_recent": true, "do_not_create_commit_status": true, "ignore_fail_on_project_status": true, "concurrent_pipeline_runs": true, "git_changeset_base": "LATEST_RUN_MATCHING_REF", "filesystem_changeset_base": "CONTENTS", "project": { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website", "html_url": "https://app.buddy.works/buddy/company-website", "name": "company-website", "display_name": "Company Website", "status": "ACTIVE" }, "creator": { "url": "https://api.buddy.works/workspaces/buddy/member/1", "html_url": "https://app.buddy.works/buddy/profile/1", "id": 1, "name": "Mike Benson", "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png" }, "actions": [], "permissions": { "others": "DENIED", "users": [ { "id": 2, "access_level": "READ_ONLY" } ], "groups": [ { "id": 1, "access_level": "READ_ONLY" } ] } }
STATUS
201 Created
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999