workflows

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package workflows provides a service for managing Intercom workflows.

Supports exporting workflow definitions for backup and migration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Export

type Export struct {
	ExportVersion string    `json:"export_version"`
	ExportedAt    string    `json:"exported_at"`
	AppID         int       `json:"app_id"`
	Workflow      *Workflow `json:"workflow"`
}

Export represents a workflow export containing the complete workflow configuration.

func ParseExportResult

func ParseExportResult(r *api.Result) (*Export, error)

ParseExportResult decodes a Result into an Export.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles communication with the workflow related methods of the Intercom API.

func NewService

func NewService(c api.Caller) *Service

NewService creates a new workflows service.

func (*Service) Export

func (s *Service) Export(ctx context.Context, id string) (*Export, error)

Export retrieves the complete workflow configuration by its ID.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/workflows/exportworkflow

func (*Service) ExportRaw

func (s *Service) ExportRaw(ctx context.Context, id string) (*api.Result, error)

ExportRaw retrieves the complete workflow configuration by its ID and returns the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/workflows/exportworkflow

type Workflow

type Workflow struct {
	ID               string           `json:"id"`
	Title            string           `json:"title"`
	Description      *string          `json:"description"`
	TriggerType      string           `json:"trigger_type"`
	State            string           `json:"state"`
	TargetChannels   []string         `json:"target_channels"`
	PreferredDevices []string         `json:"preferred_devices"`
	CreatedAt        string           `json:"created_at"`
	UpdatedAt        string           `json:"updated_at"`
	Targeting        map[string]any   `json:"targeting"`
	Snapshot         map[string]any   `json:"snapshot"`
	Attributes       []map[string]any `json:"attributes"`
	EmbeddedRules    []map[string]any `json:"embedded_rules"`
}

Workflow represents a workflow configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL