n8n

package
v0.97.8 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package n8n implements the n8n workflow automation provider.

Index

Constants

View Source
const (
	ID          = "n8n"
	EndpointKey = "endpoint"
	ApiKeyKey   = "api_key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type N8N

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

func GetClient

func GetClient() (*N8N, error)

func NewN8N

func NewN8N(endpoint, apiKey string) *N8N

func (*N8N) ActivateWorkflow

func (v *N8N) ActivateWorkflow(id string) error

ActivateWorkflow activates a workflow

func (*N8N) CreateWorkflow

func (v *N8N) CreateWorkflow(workflow *Workflow) (*Workflow, error)

CreateWorkflow creates a new workflow

func (*N8N) DeactivateWorkflow

func (v *N8N) DeactivateWorkflow(id string) error

DeactivateWorkflow deactivates a workflow

func (*N8N) DeleteWorkflow

func (v *N8N) DeleteWorkflow(id string) error

DeleteWorkflow deletes a workflow by ID

func (*N8N) ExecuteWorkflow

func (v *N8N) ExecuteWorkflow(id string, data map[string]any) error

ExecuteWorkflow executes a workflow via webhook with optional input data

func (*N8N) GetWorkflow

func (v *N8N) GetWorkflow(id string) (*Workflow, error)

GetWorkflow retrieves a workflow by ID

func (*N8N) ListWorkflows

func (v *N8N) ListWorkflows() ([]*Workflow, error)

ListWorkflows retrieves all workflows

func (*N8N) UpdateWorkflow

func (v *N8N) UpdateWorkflow(id string, workflow *Workflow) (*Workflow, error)

UpdateWorkflow updates an existing workflow

type Node

type Node struct {
	ID               string         `json:"id,omitempty"`
	Name             string         `json:"name,omitempty"`
	Type             string         `json:"type,omitempty"`
	TypeVersion      float64        `json:"typeVersion,omitempty"`
	Position         []float64      `json:"position,omitempty"`
	Parameters       map[string]any `json:"parameters,omitempty"`
	Credentials      map[string]any `json:"credentials,omitempty"`
	Notes            string         `json:"notes,omitempty"`
	NotesInFlow      bool           `json:"notesInFlow,omitempty"`
	Disabled         bool           `json:"disabled,omitempty"`
	ContinueOnFail   bool           `json:"continueOnFail,omitempty"`
	AlwaysOutputData bool           `json:"alwaysOutputData,omitempty"`
	ExecuteOnce      bool           `json:"executeOnce,omitempty"`
	RetryOnFail      bool           `json:"retryOnFail,omitempty"`
	MaxTries         int            `json:"maxTries,omitempty"`
	WaitBetweenTries int            `json:"waitBetweenTries,omitempty"`
	WebhookID        string         `json:"webhookId,omitempty"`
}

Node represents a node in an n8n workflow

type Tag

type Tag struct {
	ID        string    `json:"id,omitempty"`
	Name      string    `json:"name,omitempty"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Tag represents a tag in n8n

type Workflow

type Workflow struct {
	ID           string         `json:"id,omitempty"`
	Name         string         `json:"name,omitempty"`
	Active       bool           `json:"active,omitempty"`
	Nodes        []Node         `json:"nodes,omitempty"`
	Connections  map[string]any `json:"connections,omitempty"`
	CreatedAt    *time.Time     `json:"createdAt,omitempty"`
	UpdatedAt    *time.Time     `json:"updatedAt,omitempty"`
	Settings     map[string]any `json:"settings,omitempty"`
	StaticData   map[string]any `json:"staticData,omitempty"`
	Tags         []Tag          `json:"tags,omitempty"`
	TriggerCount int            `json:"triggerCount,omitempty"`
}

Workflow represents an n8n workflow

Jump to

Keyboard shortcuts

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