Blueprints

Create HubSpot Tickets Automatically for Incident Management

Source

yaml
id: create-hubspot-ticket-on-failure
namespace: system

tasks:
  - id: create_ticket
    type: io.kestra.plugin.hubspot.tickets.Create
    apiKey: my_api_key
    subject: Workflow failed
    content: "{{ trigger.executionId }} has failed on {{ taskrun.startDate }}"
    stage: 3
    priority: HIGH

triggers:
  - id: on_failure
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespace
        namespace: company
        comparison: PREFIX

About this blueprint

Core Infrastructure System

This system blueprint implements an incident management and customer support integration pattern by automatically creating HubSpot tickets whenever a Kestra workflow execution fails.

It demonstrates how to:

  1. Monitor workflow executions globally using a system-level flow trigger.
  2. Automatically detect failed or warning executions across all namespaces with a specific prefix.
  3. Create high-priority HubSpot tickets enriched with execution metadata such as execution ID and failure timestamp.
  4. Track workflow failures that impact customer-facing processes directly in HubSpot alongside other support tickets.
  5. Extend the workflow with additional enrichment, routing logic, or escalation steps based on failure context.

This pattern is ideal for customer support, operations, and platform teams who need visibility into workflow failures affecting customer data or business-critical processes.

You can customize this system flow by modifying the task, adding more tasks, or adjusting the trigger conditions. Read more about this pattern in the Administrator Guide.

Example failure flow used to trigger this system flow:

yaml
id: failure_flow
namespace: company.team

tasks:
  - id: always_fails
    type: io.kestra.plugin.core.execution.Fail

Whenever the failure_flow is executed and fails, this system blueprint automatically creates a corresponding ticket in HubSpot, helping teams track and resolve workflow-related incidents efficiently.

Create

Flow

Execution Status

Execution Namespace

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra