Skip to main content

Codefresh Destination

Nexla's bi-directional connectors allow data to flow both to and from any location, making it simple to create a FlexFlow or Spark ETL data flow that sends data to a Codefresh location. With the Codefresh destination, you can trigger pipeline runs, create and update pipelines, manage projects and integration contexts, create triggers, and control in-progress builds directly from your Nexla data flows.
codefresh_api.png

Codefresh

Create a Codefresh Destination

  1. Click the + icon on the Nexset that will be sent to the Codefresh destination, and select the Send to Destination option from the menu.

  2. Select the Codefresh connector from the list of available destination connectors. Then, select the credential that will be used to connect to the Codefresh account, and click Next; or, create a new Codefresh credential for use in this flow.

  3. In Nexla, Codefresh destinations can be created using pre-built endpoint templates, which expedite destination setup for common Codefresh endpoints. Each template is designed specifically for the corresponding Codefresh endpoint, making destination configuration easy and efficient.
    • To configure this destination using a template, follow the instructions in Configure Using a Template.

    Codefresh destinations can also be configured manually, allowing you to send data to Codefresh endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this destination manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Codefresh endpoints. Each template is designed specifically for the corresponding Codefresh endpoint, making destination setup easy and efficient.

  • To configure this destination using a template, select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

    Run Pipeline

    This endpoint triggers a pipeline run by project and pipeline name. Use it to programmatically start builds from your Nexla flows. The request body may include a branch, variables, and options such as noCache and resetVolume.

    • Enter the Codefresh project that owns the pipeline in the Project Name field. This is the name of the project that groups the target pipeline.
    • Enter the name of the pipeline to run within the project in the Pipeline Name field.
    • Each Nexset record is sent as the JSON request body. Include any run options (such as branch, variables, noCache, or resetVolume) as fields in the record.

    Triggering a pipeline run requires a key with the appropriate Pipeline and Build scopes. The project and pipeline names must match those configured in Codefresh.

    Create Pipeline

    This endpoint creates a new pipeline definition with a YAML spec, triggers, and runtime settings. Use it to provision pipelines programmatically from records in your data flow.

    • This endpoint requires no additional path parameters. Each Nexset record is sent as the JSON request body and should contain the full pipeline definition, including the pipeline metadata and specification.

    Pipelines are grouped within projects, so the pipeline definition should reference the project that the new pipeline belongs to.

    Update Pipeline

    This endpoint updates an existing pipeline definition (YAML, variables, triggers, and runtime) by ID. Use it to apply configuration changes to pipelines from your data flow.

    • Enter the ID of the pipeline to update in the Pipeline ID field. You can obtain pipeline IDs from the "List Pipelines" source endpoint.
    • Each Nexset record is sent as the JSON request body and should contain the updated pipeline definition.

    Updating a pipeline replaces its configuration with the values in the request body, so include the complete updated definition rather than only the changed fields.

    Delete Pipeline

    This endpoint deletes a pipeline by its ID. Use it to remove pipelines that are no longer needed as part of an automated cleanup or lifecycle flow.

    • Enter the ID of the pipeline to delete in the Pipeline ID field. You can obtain pipeline IDs from the "List Pipelines" source endpoint.

    Deleting a pipeline is irreversible. Confirm the pipeline ID before activating a flow that uses this endpoint.

    Terminate Pipeline Build

    This endpoint terminates (cancels) an in-progress pipeline build by its workflow ID. Use it to stop running builds programmatically, for example in response to an external condition detected in your data flow.

    • Enter the workflow/build ID of the in-progress run to terminate in the Build ID field. You can obtain build IDs from the "List Pipeline Builds/Runs" source endpoint.

    Only builds that are currently running can be terminated. Builds that have already completed are not affected by this endpoint.

    Restart Pipeline Build

    This endpoint restarts (re-runs) a previously executed pipeline build using the same parameters. Use it to retry failed builds or re-run a build without reconfiguring its parameters.

    • Enter the workflow/build ID of the previous run to restart in the Build ID field. You can obtain build IDs from the "List Pipeline Builds/Runs" source endpoint.

    Restarting a build reuses the parameters from the original run, making it useful for retrying transient failures.

    Create Project

    This endpoint creates a new project to group related pipelines. Use it to organize pipelines programmatically—for example, creating one project per application or team.

    • This endpoint requires no additional path parameters. Each Nexset record is sent as the JSON request body and should contain the project definition, such as the project name and tags.

    A project acts as a folder that groups related pipelines, such as all pipelines for the microservices of a single application.

    Delete Project

    This endpoint deletes a project by its ID. Use it to remove projects that are no longer needed as part of an automated lifecycle flow.

    • Enter the ID of the project to delete in the Project ID field. You can obtain project IDs from the "List Projects" source endpoint.

    Deleting a project is irreversible. Confirm the project ID before activating a flow that uses this endpoint.

    Create Integration Context

    This endpoint creates a new integration context, such as a Git provider, registry, or cloud provider. Integration contexts store the configuration that pipelines use to connect to external systems.

    • This endpoint requires no additional path parameters. Each Nexset record is sent as the JSON request body and should contain the context definition, including its type and configuration details.

    Integration contexts let pipelines reference shared connection details (for example, registry credentials) without hardcoding them in each pipeline.

    Delete Integration Context

    This endpoint deletes an integration context by its name. Use it to clean up contexts that are no longer needed.

    • Enter the name of the integration context to delete in the Context Name field. You can obtain context names from the "List Contexts" source endpoint.

    Integration contexts are identified by name. Ensure no active pipelines depend on a context before deleting it.

    Create Pipeline Trigger

    This endpoint creates a new trigger (Git, Cron, or Helm) on a pipeline. Triggers define the events that automatically start a pipeline.

    • This endpoint requires no additional path parameters. Each Nexset record is sent as the JSON request body and should contain the trigger definition, including the target pipeline and the trigger type and configuration.

    Use a Git trigger to start a pipeline on repository events, a Cron trigger to run on a schedule, or a Helm trigger to respond to Helm chart updates.

Configure Manually

Codefresh destinations can be manually configured to send data to any valid Codefresh API endpoint.

Using manual configuration, you can also configure Nexla to automatically send the response received from the Codefresh API after each call to a new Nexla webhook data source, allowing you to track build IDs, statuses, and other details returned by the API.

API Method

  1. To manually configure this destination, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Codefresh API from the Method pulldown menu. Codefresh write operations typically use POST to create resources or trigger actions, PUT to update existing resources, and DELETE to remove resources.

Data Format

  1. Select the format in which the Nexset data will be sent to the Codefresh API from the Content Format pulldown menu. The Codefresh API expects JSON, so select JSON. Nexla will automatically convert the data to the selected format for each API call.

API Endpoint URL

  1. Enter the URL of the Codefresh API endpoint to which you want to send the Nexset data in the URL field. For update or delete operations, include the ID of the target object at the end of the URL. For example, to update a pipeline use https://g.codefresh.io/api/pipelines/<pipeline_id>.

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this destination, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (e.g., header1:value1,header2:value2).

    You do not need to include any headers already present in the credentials. The Authorization header containing your Codefresh API key is added automatically by Nexla based on your credential configuration.

Exclude Attributes from the Call

Optional
  • If any record attributes in the Nexset should be omitted when sending data to this Codefresh destination, select the attributes from the Exclude Attributes pulldown menu.

  • Any number of attributes can be selected for exclusion, and all excluded attributes will be shown in the field. To remove an attribute from the list, click the X icon next to the attribute name.

Record Batching

Optional
  1. If records should be sent to this destination in batched API calls, check the box next to Would you like to batch your records together? to enable record batching.

  2. Enter the maximum number of records that should be batched together in a single API call in the Batch Size field. By default, this value is set to 100.

  3. Select the algorithm that will be used to group records into batches from the Grouping Algorithm pulldown menu. The sample request shown in the panel on the right will be updated to reflect the current batching settings.

Codefresh write endpoints generally operate on a single resource per request (for example, creating one pipeline or triggering one build). For these operations, leave batching disabled so that each record is sent as an individual API call.

Response Webhook

Optional

Nexla can automatically send the response received from the Codefresh API after each call to a new Nexla webhook data source. This option allows you to keep track of the status of each API call and any additional information returned after each call, such as the build ID returned when a pipeline run is triggered.

  • To enable this option, check the box next to Would you like to process the API response as a Nexla Webhook source?.

Sample Request Payload

Sample request payloads containing a portion of the Nexset data that will be sent to the Codefresh API endpoint based on the current settings are shown in the Sample Payload panel on the right. These samples can be referenced to ensure that the destination and request settings are correctly configured.

  • Click on a sample request payload to expand it and view the complete payload content.
  • Sample payloads are automatically updated with each setting change, making it easy to verify that changes achieve the desired effect.

Endpoint Testing (Manual Configuration)

After all endpoint settings have been configured, Nexla can send a test payload to the Codefresh API to ensure that the destination is configured correctly.

  1. To send a test payload, select the Test button at the top of the Sample Payload panel, and click on a listed sample payload to expand it.

  2. If any modifications to the sample payload are needed, make the necessary changes directly within the sample window.

  3. Click the Send Test Data button at the top of a sample payload to send the test payload to the Codefresh API using the current settings.

Save & Activate the Destination

  • Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To begin sending data to Codefresh, open the destination resource menu, and select Activate.

    The Nexset data will not be sent to Codefresh until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.