core

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoValidEnum = errors.New("not a valid enum")

Functions

func DeepCopy

func DeepCopy(data interface{}) interface{}

DeepCopy creates a deep copy of a JSON value

func ExcludeFromMap

func ExcludeFromMap(m map[string]interface{}, keys []string) map[string]interface{}

ExcludeFromMap returns a new map excluding the specified keys

func FilterMap

func FilterMap(m map[string]interface{}, keys []string) map[string]interface{}

FilterMap returns a new map containing only the specified keys

func FormatJSONValue

func FormatJSONValue(value interface{}) string

FormatJSONValue formats a JSON value as a string for display

func GetArray

func GetArray(data JSON, path string) ([]interface{}, error)

GetArray retrieves an array from a JSON object at the specified path

func GetAuthDisplayName

func GetAuthDisplayName(authType AuthType) string

GetAuthDisplayName returns a human-readable name for an auth type

func GetAuthIcon

func GetAuthIcon(authType AuthType) string

GetAuthIcon returns an appropriate icon for an auth type

func GetBool

func GetBool(data JSON, path string) (bool, error)

GetBool retrieves a boolean value from a JSON object at the specified path

func GetFloat

func GetFloat(data JSON, path string) (float64, error)

GetFloat retrieves a float value from a JSON object at the specified path

func GetInt

func GetInt(data JSON, path string) (int, error)

GetInt retrieves an integer value from a JSON object at the specified path

func GetObject

func GetObject(data JSON, path string) (map[string]interface{}, error)

GetObject retrieves an object (map) from a JSON object at the specified path

func GetPathValue

func GetPathValue(obj interface{}, path string) (interface{}, bool)

GetPathValue gets a value from a nested structure using dot notation path

func GetString

func GetString(data JSON, path string) (string, error)

GetString retrieves a string value from a JSON object at the specified path

func GetTriggerDisplayName

func GetTriggerDisplayName(triggerType TriggerType) string

GetTriggerDisplayName returns a human-readable name for a trigger type

func GetTriggerIcon

func GetTriggerIcon(triggerType TriggerType) string

GetTriggerIcon returns an icon name for a trigger type

func GetValue

func GetValue(data JSON, path string) (interface{}, error)

GetValue retrieves a value from a JSON object at the specified path

func MergeJSON

func MergeJSON(target, source map[string]interface{}) map[string]interface{}

MergeJSON merges source JSON into target JSON

func MergeMaps

func MergeMaps(maps ...map[string]interface{}) map[string]interface{}

MergeMaps merges multiple maps into a single map

func ParseJSONPath

func ParseJSONPath(path string) ([]string, error)

ParseJSONPath parses a JSON path and validates it

func RemoveValue

func RemoveValue(data map[string]interface{}, path string) error

RemoveValue removes a value from a JSON object at the specified path

func SetPathValue

func SetPathValue(obj map[string]interface{}, path string, value interface{}) (map[string]interface{}, bool)

SetPathValue sets a value in a nested structure using dot notation path

func SetValue

func SetValue(data map[string]interface{}, path string, value interface{}) error

SetValue sets a value in a JSON object at the specified path

Types

type APITriggerCriteria

type APITriggerCriteria struct {
	// Enabled determines if the API trigger is active
	Enabled bool `json:"enabled"`

	// Endpoint is the API endpoint path
	Endpoint string `json:"endpoint,omitempty"`

	// Method is the HTTP method for the API endpoint
	Method string `json:"method,omitempty"`

	// Authentication determines if authentication is required
	Authentication bool `json:"authentication"`

	// RequiredScope is the required OAuth scope
	RequiredScope string `json:"requiredScope,omitempty"`

	// InputSchema defines the expected input schema
	InputSchema *smartform.FormSchema `json:"inputSchema,omitempty"`

	// RateLimit is the maximum number of requests per minute
	RateLimit int `json:"rateLimit,omitempty"`
}

APITriggerCriteria defines criteria for API-triggered workflows

func NewAPITriggerCriteria

func NewAPITriggerCriteria() *APITriggerCriteria

NewAPITriggerCriteria creates a new APITriggerCriteria with default values

func (*APITriggerCriteria) SetDefaults

func (c *APITriggerCriteria) SetDefaults()

SetDefaults applies default values to APITriggerCriteria

type ActionSettings

type ActionSettings struct {
	Branch *RouterSettings `json:"branch,omitempty"`
}

type ActionType

type ActionType string

ActionType defines the type of action in a workflow.

const (
	// ActionTypeAction represents a standard action.
	ActionTypeAction ActionType = "ACTION"

	// ActionTypeBranch represents a branch action that can conditionally execute different paths.
	ActionTypeBranch ActionType = "BRANCH"

	// ActionTypeBoolean represents a boolean-conditional action.
	ActionTypeBoolean ActionType = "BOOLEAN"

	// ActionTypeLoop represents a loop action.
	ActionTypeLoop ActionType = "LOOP"

	// ActionTypeRouter represents a router action that can direct flow based on conditions.
	ActionTypeRouter ActionType = "ROUTER"
)

func ActionTypeFromString

func ActionTypeFromString(raw string) (ActionType, bool)

ActionTypeFromString determines the enum value with an exact case match.

func ActionTypeFromStringIgnoreCase

func ActionTypeFromStringIgnoreCase(raw string) (ActionType, bool)

ActionTypeFromStringIgnoreCase determines the enum value with a case-insensitive match.

func (ActionType) IsValid

func (_j ActionType) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (ActionType) MarshalBinary

func (_j ActionType) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for ActionType.

func (ActionType) MarshalGQL

func (_j ActionType) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for ActionType.

func (ActionType) MarshalJSON

func (_j ActionType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ActionType.

func (ActionType) MarshalText

func (_j ActionType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for ActionType.

func (ActionType) MarshalYAML

func (_j ActionType) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for ActionType.

func (ActionType) SQLTypeName

func (ActionType) SQLTypeName() string

func (*ActionType) Scan

func (_j *ActionType) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for ActionType.

func (ActionType) String

func (_j ActionType) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern ActionType(%d) instead.

func (*ActionType) UnmarshalBinary

func (_j *ActionType) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for ActionType.

func (*ActionType) UnmarshalGQL

func (_j *ActionType) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for ActionType.

func (*ActionType) UnmarshalJSON

func (_j *ActionType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ActionType.

func (*ActionType) UnmarshalText

func (_j *ActionType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for ActionType.

func (*ActionType) UnmarshalYAML

func (_j *ActionType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for ActionType.

func (ActionType) Validate

func (_j ActionType) Validate() error

Validate whether the value is within the range of enum values.

func (ActionType) Values

func (ActionType) Values() []string

Values returns a slice of all String values of the enum.

type AuthMetadata

type AuthMetadata struct {
	// Type of authentication (oauth2, api_key, basic, etc.)
	Type     AuthType `json:"type"`
	Schema   *smartform.FormSchema
	Required bool `json:"required"`
	Inherit  bool `json:"inherit"`
}

AuthMetadata defines the authentication configuration for an integration

type AuthType

type AuthType string

AuthType defines the types of authentication supported by the system

const (
	// None indicates no authentication is required
	None AuthType = "none"

	// Basic indicates username and password authentication
	Basic AuthType = "basic"

	// Secret indicates a shared secret or token authentication
	Secret AuthType = "secret"

	// APIKey indicates API key authentication
	APIKey AuthType = "api_key"

	// OAuth2 indicates OAuth 2.0 authentication
	OAuth2 AuthType = "oauth2"

	// Custom indicates a custom authentication method
	Custom AuthType = "custom"

	// JWT indicates JSON Web Token authentication
	JWT AuthType = "jwt"

	// ApiKeyHeader indicates an API key in the header
	ApiKeyHeader AuthType = "api_key_header"

	// ApiKeyQuery indicates an API key in the query string
	ApiKeyQuery AuthType = "api_key_query"

	// BearerToken indicates a bearer token authentication
	BearerToken AuthType = "bearer_token"

	// ClientCert indicates client certificate authentication
	ClientCert AuthType = "client_cert"
)

func AuthTypeFromString

func AuthTypeFromString(raw string) (AuthType, bool)

AuthTypeFromString determines the enum value with an exact case match

func AuthTypeFromStringIgnoreCase

func AuthTypeFromStringIgnoreCase(raw string) (AuthType, bool)

AuthTypeFromStringIgnoreCase determines the enum value with a case-insensitive match

func (AuthType) IsValid

func (_j AuthType) IsValid() bool

IsValid tests whether the value is a valid enum value

func (AuthType) MarshalBinary

func (_j AuthType) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler

func (AuthType) MarshalGQL

func (_j AuthType) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler

func (AuthType) MarshalJSON

func (_j AuthType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (AuthType) MarshalText

func (_j AuthType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (AuthType) MarshalYAML

func (_j AuthType) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler

func (AuthType) SQLTypeName

func (AuthType) SQLTypeName() string

SQLTypeName returns the SQL type name for serialization

func (*AuthType) Scan

func (_j *AuthType) Scan(value interface{}) error

Scan implements sql/driver.Scanner

func (AuthType) String

func (_j AuthType) String() string

String returns the string representation of the enum value

func (*AuthType) UnmarshalBinary

func (_j *AuthType) UnmarshalBinary(text []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler

func (*AuthType) UnmarshalGQL

func (_j *AuthType) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements graphql.Unmarshaler

func (*AuthType) UnmarshalJSON

func (_j *AuthType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*AuthType) UnmarshalText

func (_j *AuthType) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

func (*AuthType) UnmarshalYAML

func (_j *AuthType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler

func (AuthType) Validate

func (_j AuthType) Validate() error

Validate whether the value is within the range of enum values

func (AuthType) Values

func (AuthType) Values() []string

Values returns a slice of all string values for the enum

type BranchMode

type BranchMode string

BranchMode defines how branches in a workflow are selected.

const (
	// BranchModeExpression uses a JavaScript expression to determine the branch
	BranchModeExpression BranchMode = "expression"

	// BranchModeCondition uses field-based condition matching
	BranchModeCondition BranchMode = "condition"

	// BranchModeValue uses direct value matching
	BranchModeValue BranchMode = "value"
)

type EventTriggerCriteria

type EventTriggerCriteria struct {
	// EventName specifies the name of the event to subscribe to
	EventName string `json:"eventName" validate:"required"`

	// Source specifies the source of the event
	Source string `json:"source" validate:"required"`

	// Filters allow refining event criteria
	Filters map[string]any `json:"filters,omitempty"`

	// EventPattern is a pattern to match against the event
	EventPattern string `json:"eventPattern,omitempty"`

	// MaxEvents is the maximum number of events to process at once
	MaxEvents int `json:"maxEvents,omitempty"`

	// Deduplicate determines if duplicate events should be filtered
	Deduplicate bool `json:"deduplicate"`

	// Batching determines if events should be batched
	Batching bool `json:"batching"`

	// BatchSize is the number of events to include in a batch
	BatchSize int `json:"batchSize,omitempty"`

	// BatchWindow is the time window for event batching
	BatchWindow string `json:"batchWindow,omitempty"`
}

EventTriggerCriteria defines trigger criteria based on system or external events

func NewEventTriggerCriteria

func NewEventTriggerCriteria() *EventTriggerCriteria

NewEventTriggerCriteria initializes a new EventTriggerCriteria instance with default values

func (*EventTriggerCriteria) SetDefaults

func (c *EventTriggerCriteria) SetDefaults()

SetDefaults applies default values for EventTriggerCriteria

type FlowRouter

type FlowRouter struct {
	// ID is the unique identifier of the branch
	ID string `json:"id,omitempty"`

	// Name is the display name of the branch
	Name string `json:"name,omitempty"`

	// Condition is the condition expression for this branch
	Condition string `json:"condition,omitempty"`

	// Value is the expected value for this branch
	// (used with BranchModeValue)
	Value interface{} `json:"value,omitempty"`

	// Order determines the evaluation order of branches
	Order int `json:"order,omitempty"`

	// NextStep is the ID of the step to execute if this branch is selected
	NextStep string `json:"nextStep,omitempty"`

	// IsDefault indicates if this is the default branch
	IsDefault bool `json:"isDefault,omitempty"`

	// ConditionField is the specific field to evaluate for this branch
	ConditionField string `json:"conditionField,omitempty"`

	// ConditionOperator defines how to compare values for this branch
	ConditionOperator string `json:"conditionOperator,omitempty"`

	// ConditionValue is the value to compare against for this branch
	ConditionValue interface{} `json:"conditionValue,omitempty"`
}

FlowRouter represents a single branch option in a branching flow.

type IntegrationBuildMetadata

type IntegrationBuildMetadata struct {
	Platform IntegrationPlatform `json:"compiler"`
	Language IntegrationLanguage `json:"language,omitempty"`
}

IntegrationBuildMetadata is a build metadata for integrations.

type IntegrationLanguage

type IntegrationLanguage string

IntegrationLanguage represents programming languages supported for plugins.

const (
	IntegrationLanguageJavaScript IntegrationLanguage = "javascript"
	IntegrationLanguageTypeScript IntegrationLanguage = "typescript"
	IntegrationLanguagePython     IntegrationLanguage = "python"
	IntegrationLanguageGo         IntegrationLanguage = "go"
	IntegrationLanguageRuby       IntegrationLanguage = "ruby"
	IntegrationLanguageJava       IntegrationLanguage = "java"
	IntegrationLanguageCSharp     IntegrationLanguage = "csharp"
)

func IntegrationLanguageFromString

func IntegrationLanguageFromString(raw string) (IntegrationLanguage, bool)

IntegrationLanguageFromString determines the enum value with an exact case match.

func (IntegrationLanguage) IsValid

func (_j IntegrationLanguage) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (IntegrationLanguage) MarshalGQL

func (_j IntegrationLanguage) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for IntegrationLanguage.

func (IntegrationLanguage) MarshalJSON

func (_j IntegrationLanguage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for IntegrationLanguage.

func (IntegrationLanguage) SQLTypeName

func (IntegrationLanguage) SQLTypeName() string

func (IntegrationLanguage) String

func (_j IntegrationLanguage) String() string

String returns the string of the enum value.

func (*IntegrationLanguage) UnmarshalGQL

func (_j *IntegrationLanguage) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for IntegrationLanguage.

func (*IntegrationLanguage) UnmarshalJSON

func (_j *IntegrationLanguage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for IntegrationLanguage.

func (IntegrationLanguage) Validate

func (_j IntegrationLanguage) Validate() error

Validate whether the value is within the range of enum values.

func (IntegrationLanguage) Values

func (IntegrationLanguage) Values() []string

Values returns a slice of all String values of the enum.

type IntegrationPlatform

type IntegrationPlatform string

IntegrationPlatform represents the type of a plugin.

const (
	IntegrationPlatformNative IntegrationPlatform = "native"
	IntegrationPlatformWASM   IntegrationPlatform = "wasm"
)

func IntegrationPlatformFromString

func IntegrationPlatformFromString(raw string) (IntegrationPlatform, bool)

IntegrationPlatformFromString determines the enum value with an exact case match.

func (IntegrationPlatform) IsValid

func (_j IntegrationPlatform) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (IntegrationPlatform) MarshalJSON

func (_j IntegrationPlatform) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for IntegrationPlatform.

func (IntegrationPlatform) SQLTypeName

func (IntegrationPlatform) SQLTypeName() string

func (IntegrationPlatform) String

func (_j IntegrationPlatform) String() string

String returns the string of the enum value.

func (*IntegrationPlatform) UnmarshalJSON

func (_j *IntegrationPlatform) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for IntegrationPlatform.

func (IntegrationPlatform) Validate

func (_j IntegrationPlatform) Validate() error

Validate whether the value is within the range of enum values.

func (IntegrationPlatform) Values

func (IntegrationPlatform) Values() []string

Values returns a slice of all String values of the enum.

type JSON

type JSON interface{}

JSON is a generic type for JSON values

func ToJSON

func ToJSON(input any) (JSON, bool)

ToJSON converts an interface of type `any` to a map[string]any. Returns the map and a boolean indicating success.

type JSONObject

type JSONObject = map[string]any

JSONObject is a type alias for map[string]any.

func ToJSONMap

func ToJSONMap(input any) (JSONObject, bool)

ToJSONMap converts an interface of type `any` to a map[string]any. Returns the map and a boolean indicating success.

type Log

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

func NewLog

func NewLog(
	projectID string,
	flowID string,
	stepRunID *string,
	onWrite func(WriteLogLineOpts),
) *Log

func (*Log) Debug

func (b *Log) Debug() *LogBuilder

func (*Log) Error

func (b *Log) Error() *LogBuilder

func (*Log) Info

func (b *Log) Info() *LogBuilder

func (*Log) Warn

func (b *Log) Warn() *LogBuilder

type LogBuilder

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

func NewLogBuilder

func NewLogBuilder(
	ops *WriteLogLineOpts,
	onWrite func(WriteLogLineOpts),
) *LogBuilder

func (*LogBuilder) Meta

func (b *LogBuilder) Meta(meta map[string]interface{}) *LogBuilder

func (*LogBuilder) Msg

func (b *LogBuilder) Msg(message string)

type LogEntry

type LogEntry struct {
	Timestamp time.Time `json:"timestamp"` // Timestamp of the log
	Level     LogLevel  `json:"level"`     // Severity level of the log
	Message   string    `json:"message"`   // Log message itself
}

LogEntry represents a single log message with a timestamp and level.

type LogLevel

type LogLevel string

LogLevel represents the severity of a log.

const (
	LevelInfo    LogLevel = "INFO"
	LevelWarning LogLevel = "WARNING"
	LevelError   LogLevel = "ERROR"
	LevelDebug   LogLevel = "DEBUG" // Optional: for verbose debugging messages
)

type LogLine

type LogLine struct {
	// ID of the ent.
	ID xid.ID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ProjectID holds the value of the "team_id" field.
	ProjectID xid.ID `json:"project_id,omitempty"`
	// StepRunID holds the value of the "step_run_id" field.
	StepRunID *string `json:"step_run_id,omitempty"`
	// FlowID holds the value of the "step_run_id" field.
	FlowID *string `json:"flow_id,omitempty"`
	// Message holds the value of the "message" field.
	Message string `json:"message,omitempty"`
	// Level holds the value of the "level" field.
	Level LogLineLevel `json:"level,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

LogLine is the model entity for the LogLine schema.

type LogLineLevel

type LogLineLevel string

LogLineLevel represents the kind of job to be started.

const (
	LogLineLevelDebug LogLineLevel = "DEBUG"
	LogLineLevelInfo  LogLineLevel = "INFO"
	LogLineLevelWarn  LogLineLevel = "WARN"
	LogLineLevelError LogLineLevel = "ERROR"
)

Available job kinds.

func LogLineLevelFromString

func LogLineLevelFromString(raw string) (LogLineLevel, bool)

LogLineLevelFromString determines the enum value with an exact case match.

func LogLineLevelFromStringIgnoreCase

func LogLineLevelFromStringIgnoreCase(raw string) (LogLineLevel, bool)

LogLineLevelFromStringIgnoreCase determines the enum value with a case-insensitive match.

func (LogLineLevel) IsValid

func (_j LogLineLevel) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (LogLineLevel) MarshalBinary

func (_j LogLineLevel) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for LogLineLevel.

func (LogLineLevel) MarshalGQL

func (_j LogLineLevel) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for LogLineLevel.

func (LogLineLevel) MarshalJSON

func (_j LogLineLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for LogLineLevel.

func (LogLineLevel) MarshalText

func (_j LogLineLevel) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for LogLineLevel.

func (LogLineLevel) MarshalYAML

func (_j LogLineLevel) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for LogLineLevel.

func (LogLineLevel) SQLTypeName

func (LogLineLevel) SQLTypeName() string

func (*LogLineLevel) Scan

func (_j *LogLineLevel) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for LogLineLevel.

func (LogLineLevel) String

func (_j LogLineLevel) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern LogLineLevel(%d) instead.

func (*LogLineLevel) UnmarshalBinary

func (_j *LogLineLevel) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for LogLineLevel.

func (*LogLineLevel) UnmarshalGQL

func (_j *LogLineLevel) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for LogLineLevel.

func (*LogLineLevel) UnmarshalJSON

func (_j *LogLineLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for LogLineLevel.

func (*LogLineLevel) UnmarshalText

func (_j *LogLineLevel) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for LogLineLevel.

func (*LogLineLevel) UnmarshalYAML

func (_j *LogLineLevel) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for LogLineLevel.

func (LogLineLevel) Validate

func (_j LogLineLevel) Validate() error

Validate whether the value is within the range of enum values.

func (LogLineLevel) Values

func (LogLineLevel) Values() []string

Values returns a slice of all String values of the enum.

type LogSink

type LogSink interface {
	Write(ctx context.Context, logEntry LogEntry) error // Write a log entry to the sink
}

LogSink defines an interface for persisting logs to external systems.

type Logger

type Logger interface {
	AddLog(ctx context.Context, level LogLevel, message string)
	SetPrefix(prefix string)
	GetLogs() []LogEntry
	ClearLogs()
	LogInfo(ctx context.Context, message string)
	LogWarning(ctx context.Context, message string)
	LogError(ctx context.Context, err error)
	LogDebug(ctx context.Context, message string)
}

Logger provides a centralized interface for managing logs.

type ManualTriggerCriteria

type ManualTriggerCriteria struct {
	// Description is an optional field to describe the purpose of the manual trigger
	Description string `json:"description,omitempty"`

	// UserInputSchema defines a schema for the input required when triggering manually
	UserInputSchema *smartform.FormSchema `json:"userInputSchema,omitempty"`

	// RequireApproval specifies if the manual trigger requires prior approval to execute
	RequireApproval bool `json:"requireApproval"`

	// ExecutionTimeout defines the maximum allowed time for the manual step to be completed
	ExecutionTimeout *time.Duration `json:"executionTimeout,omitempty"`

	// Approvers is a list of users who can approve the trigger
	Approvers []string `json:"approvers,omitempty"`

	// ApproverGroups is a list of groups who can approve the trigger
	ApproverGroups []string `json:"approverGroups,omitempty"`

	// Tags provide searchable metadata for this trigger
	Tags []string `json:"tags,omitempty"`

	// ShowInUI determines if this trigger should be visible in the UI
	ShowInUI bool `json:"showInUI"`

	// ButtonLabel is the text to display on the trigger button
	ButtonLabel string `json:"buttonLabel,omitempty"`

	// ButtonIcon is the icon to display on the trigger button
	ButtonIcon string `json:"buttonIcon,omitempty"`
}

ManualTriggerCriteria defines criteria for manually triggered workflows

func NewManualTriggerCriteria

func NewManualTriggerCriteria() *ManualTriggerCriteria

NewManualTriggerCriteria creates a new instance of ManualTriggerCriteria with default values

func (*ManualTriggerCriteria) SetDefaults

func (c *ManualTriggerCriteria) SetDefaults()

SetDefaults applies default values for ManualTriggerCriteria

type MessageTriggerCriteria

type MessageTriggerCriteria struct {
	// MessageType is the type of message that triggers the workflow
	MessageType string `json:"messageType,omitempty"`

	// Source is the source of the message
	Source string `json:"source,omitempty"`

	// Destination is the destination of the message
	Destination string `json:"destination,omitempty"`

	// Filter is a filter expression applied to the message
	Filter string `json:"filter,omitempty"`

	// Enabled determines if the message trigger is active
	Enabled bool `json:"enabled"`
}

MessageTriggerCriteria defines criteria for message-triggered workflows

func NewMessageTriggerCriteria

func NewMessageTriggerCriteria() *MessageTriggerCriteria

NewMessageTriggerCriteria creates a new MessageTriggerCriteria with default values

func (*MessageTriggerCriteria) SetDefaults

func (c *MessageTriggerCriteria) SetDefaults()

SetDefaults applies default values to MessageTriggerCriteria

type PollingTriggerCriteria

type PollingTriggerCriteria struct {
	// Interval defines the duration between each poll
	Interval time.Duration `json:"interval" validate:"required,gt=0"`

	// MaxRetries specifies the maximum number of retries in case polling fails
	MaxRetries int `json:"maxRetries,omitempty" validate:"min=0"`

	// FetchLimit defines the maximum number of items to fetch per poll
	FetchLimit int `json:"fetchLimit,omitempty" validate:"min=1"`

	// DataFilters allows specifying conditions for the data being fetched
	DataFilters map[string]any `json:"dataFilters,omitempty"`

	// AllowEmptyData determines if polling should proceed without error when no data is returned
	AllowEmptyData bool `json:"allowEmptyData"`

	// LastExecutionTime holds the timestamp of the last successful poll
	LastExecutionTime *time.Time `json:"lastExecutionTime,omitempty"`

	// Enabled determines whether the polling trigger is active
	Enabled bool `json:"enabled" validate:"required"`

	// ExcludedDays allows specifying days when polling should be skipped
	ExcludedDays []time.Weekday `json:"excludedDays,omitempty"`

	// ExcludedHours allows specifying hours when polling should be skipped
	ExcludedHours []int `json:"excludedHours,omitempty"`

	// TimeoutSeconds is the maximum time allowed for a polling operation
	TimeoutSeconds int `json:"timeoutSeconds,omitempty"`

	// Deduplicate determines if duplicate items should be filtered
	Deduplicate bool `json:"deduplicate"`

	// DedupKeyPath is the path to the field used for deduplication
	DedupKeyPath string `json:"dedupKeyPath,omitempty"`
}

PollingTriggerCriteria defines criteria for a polling-based trigger

func NewPollingTriggerCriteria

func NewPollingTriggerCriteria() *PollingTriggerCriteria

NewPollingTriggerCriteria initializes and returns a new PollingTriggerCriteria instance with default values

func (*PollingTriggerCriteria) SetDefaults

func (c *PollingTriggerCriteria) SetDefaults()

SetDefaults applies default values for PollingTriggerCriteria

type RetryPolicy

type RetryPolicy struct {
	// Enabled determines if retry is enabled
	Enabled bool `json:"enabled" validate:"required"`

	// MaxRetries specifies the maximum number of retry attempts
	MaxRetries int `json:"maxRetries" validate:"min=0"`

	// RetryInterval defines the time to wait between retry attempts
	RetryInterval time.Duration `json:"retryInterval" validate:"gt=0"`

	// ExponentialBackoff determines if exponential backoff is used for retries
	ExponentialBackoff bool `json:"exponentialBackoff"`

	// MaxInterval is the maximum interval between retries when using exponential backoff
	MaxInterval time.Duration `json:"maxInterval,omitempty"`

	// RetryableErrors defines which errors should be retried
	RetryableErrors []string `json:"retryableErrors,omitempty"`
}

RetryPolicy defines the retry policy for failed event triggers

func NewRetryPolicy

func NewRetryPolicy() *RetryPolicy

NewRetryPolicy creates a new RetryPolicy with default values

func (*RetryPolicy) SetDefaults

func (rp *RetryPolicy) SetDefaults()

SetDefaults applies default values for RetryPolicy

type RouterSettings

type RouterSettings struct {
	// DefaultBranch specifies which branch to follow when no condition is met
	DefaultBranch string `json:"defaultBranch,omitempty"`

	// EvaluateAll determines if all branch conditions should be evaluated
	// or only until the first match
	EvaluateAll bool `json:"evaluateAll,omitempty"`

	// Expression is a JavaScript expression that determines which branch to take
	Expression string `json:"expression,omitempty"`

	// ExpressionEngine defines which engine to use for expression evaluation
	// Default is "javascript"
	ExpressionEngine string `json:"expressionEngine,omitempty"`

	// ConditionField is the specific field to evaluate in the step's output
	ConditionField string `json:"conditionField,omitempty"`

	// ConditionOperator defines how to compare the field value (equals, contains, etc.)
	ConditionOperator string `json:"conditionOperator,omitempty"`

	// ConditionValue is the value to compare against
	ConditionValue interface{} `json:"conditionValue,omitempty"`

	// AllowMultiPath determines if multiple branches can be activated simultaneously
	AllowMultiPath bool `json:"allowMultiPath,omitempty"`

	// BranchMode defines how branches are evaluated (expression, condition, or value)
	BranchMode BranchMode `json:"branchMode,omitempty"`

	// Branches defines the specific branches available
	Branches []FlowRouter `json:"branches,omitempty"`
}

RouterSettings defines the configuration for a branching flow step.

func NewBranchSettings

func NewBranchSettings() *RouterSettings

NewBranchSettings creates a new RouterSettings with default values

func (*RouterSettings) AddBranch

func (bs *RouterSettings) AddBranch(branch FlowRouter)

AddBranch adds a new branch to the RouterSettings

func (*RouterSettings) GetBranchByID

func (bs *RouterSettings) GetBranchByID(id string) *FlowRouter

GetBranchByID retrieves a branch by its ID

func (*RouterSettings) GetDefaultBranch

func (bs *RouterSettings) GetDefaultBranch() *FlowRouter

GetDefaultBranch gets the default branch

func (*RouterSettings) SetDefaultBranch

func (bs *RouterSettings) SetDefaultBranch(id string)

SetDefaultBranch sets a branch as the default

type ScheduleTriggerCriteria

type ScheduleTriggerCriteria struct {
	// CronExpression specifies the schedule using a cron expression
	CronExpression string `json:"cronExpression" validate:"required,cron"`

	// StartTime specifies the time to begin the schedule execution
	StartTime *time.Time `json:"startTime,omitempty"`

	// EndTime specifies the time to stop the schedule execution
	EndTime *time.Time `json:"endTime,omitempty"`

	// TimeZone allows defining the time zone for the cron schedule
	TimeZone string `json:"timeZone" validate:"required"`

	// Enabled determines if the schedule trigger is active
	Enabled bool `json:"enabled" validate:"required"`

	// MaxConcurrentRuns is the maximum number of concurrent runs
	MaxConcurrentRuns int `json:"maxConcurrentRuns,omitempty"`

	// SkipIfPreviousRunning determines if a run should be skipped if the previous one is still running
	SkipIfPreviousRunning bool `json:"skipIfPreviousRunning"`

	// MissedRunPolicy defines what to do with missed runs (skip, run-once, run-all)
	MissedRunPolicy string `json:"missedRunPolicy,omitempty"`

	// Description provides additional information about the schedule
	Description string `json:"description,omitempty"`
}

ScheduleTriggerCriteria defines trigger criteria for scheduled workflows

func NewScheduleTriggerCriteria

func NewScheduleTriggerCriteria() *ScheduleTriggerCriteria

NewScheduleTriggerCriteria creates a new ScheduleTriggerCriteria with default values

func (*ScheduleTriggerCriteria) ApplyDefaults

func (c *ScheduleTriggerCriteria) ApplyDefaults()

ApplyDefaults applies default values to a ScheduleTriggerCriteria

func (*ScheduleTriggerCriteria) ScheduledInterval

func (c *ScheduleTriggerCriteria) ScheduledInterval() time.Duration

ScheduledInterval derives the scheduled interval as a time.Duration based on the cron expression

type StepRunStatus

type StepRunStatus string

StepRunStatus represents the status of a step run.

const (
	// StepRunStatusPending indicates a step is queued to run but hasn't started
	StepRunStatusPending StepRunStatus = "PENDING"

	// StepRunStatusPaused indicates a step is paused and waiting for manual continuation
	StepRunStatusPaused StepRunStatus = "PAUSED"

	// StepRunStatusRunning indicates a step is currently executing
	StepRunStatusRunning StepRunStatus = "RUNNING"

	// StepRunStatusSucceeded indicates a step has completed successfully
	StepRunStatusSucceeded StepRunStatus = "SUCCEEDED"

	// StepRunStatusFailed indicates a step has failed
	StepRunStatusFailed StepRunStatus = "FAILED"

	// StepRunStatusCancelled indicates a step was manually cancelled
	StepRunStatusCancelled StepRunStatus = "CANCELLED"

	// StepRunStatusSkipped indicates a step was skipped due to conditions or branching
	StepRunStatusSkipped StepRunStatus = "SKIPPED"

	// StepRunStatusTimeout indicates a step exceeded its allowed execution time
	StepRunStatusTimeout StepRunStatus = "TIMEOUT"

	// StepRunStatusWaiting indicates a step is waiting for an external event or condition
	StepRunStatusWaiting StepRunStatus = "WAITING"

	// StepRunStatusBlocked indicates a step is blocked by a dependency or condition
	StepRunStatusBlocked StepRunStatus = "BLOCKED"

	// StepRunStatusApproved indicates a step has been manually approved
	StepRunStatusApproved StepRunStatus = "APPROVED"

	// StepRunStatusRejected indicates a step was manually rejected
	StepRunStatusRejected StepRunStatus = "REJECTED"
)

Enum values for StepRunStatus.

func StepRunStatusFromString

func StepRunStatusFromString(raw string) (StepRunStatus, bool)

StepRunStatusFromString determines the enum value with an exact case match.

func StepRunStatusFromStringIgnoreCase

func StepRunStatusFromStringIgnoreCase(raw string) (StepRunStatus, bool)

StepRunStatusFromStringIgnoreCase determines the enum value with a case-insensitive match.

func (StepRunStatus) IsActive

func (s StepRunStatus) IsActive() bool

IsActive returns true if the status indicates the step is still active

func (StepRunStatus) IsComplete

func (s StepRunStatus) IsComplete() bool

IsComplete returns true if the status indicates the step has finished

func (StepRunStatus) IsFailed

func (s StepRunStatus) IsFailed() bool

func (StepRunStatus) IsSuccessful

func (s StepRunStatus) IsSuccessful() bool

IsSuccessful returns true if the status indicates successful completion

func (StepRunStatus) IsTerminalStatus

func (s StepRunStatus) IsTerminalStatus() bool

func (StepRunStatus) IsValid

func (_j StepRunStatus) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (StepRunStatus) MarshalBinary

func (_j StepRunStatus) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for StepRunStatus.

func (StepRunStatus) MarshalGQL

func (_j StepRunStatus) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for StepRunStatus.

func (StepRunStatus) MarshalJSON

func (_j StepRunStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for StepRunStatus.

func (StepRunStatus) MarshalText

func (_j StepRunStatus) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for StepRunStatus.

func (StepRunStatus) MarshalYAML

func (_j StepRunStatus) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for StepRunStatus.

func (StepRunStatus) SQLTypeName

func (StepRunStatus) SQLTypeName() string

SQLTypeName returns the SQL type name for serialization

func (*StepRunStatus) Scan

func (_j *StepRunStatus) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for StepRunStatus.

func (StepRunStatus) StatusColor

func (s StepRunStatus) StatusColor() string

StatusColor returns a color associated with this status for UI display

func (StepRunStatus) StatusIcon

func (s StepRunStatus) StatusIcon() string

StatusIcon returns an icon associated with this status for UI display

func (StepRunStatus) String

func (_j StepRunStatus) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern StepRunStatus(%d) instead.

func (*StepRunStatus) UnmarshalBinary

func (_j *StepRunStatus) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for StepRunStatus.

func (*StepRunStatus) UnmarshalGQL

func (_j *StepRunStatus) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for StepRunStatus.

func (*StepRunStatus) UnmarshalJSON

func (_j *StepRunStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for StepRunStatus.

func (*StepRunStatus) UnmarshalText

func (_j *StepRunStatus) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for StepRunStatus.

func (*StepRunStatus) UnmarshalYAML

func (_j *StepRunStatus) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for StepRunStatus.

func (StepRunStatus) Validate

func (_j StepRunStatus) Validate() error

Validate whether the value is within the range of enum values.

func (StepRunStatus) Values

func (StepRunStatus) Values() []string

Values returns a slice of all String values of the enum.

type SystemActivityLog

type SystemActivityLog struct {
	Level     LogLevel  `json:"level"`
	Scope     string    `json:"scope"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

type SystemActivityLogs

type SystemActivityLogs = []SystemActivityLog

type TriggerCriteria

type TriggerCriteria struct {
	// Polling specifies the configuration for polling-based triggers
	Polling *PollingTriggerCriteria `json:"pollingCriteria,omitempty"`

	// Event specifies the configuration for event-based triggers
	Event *EventTriggerCriteria `json:"eventCriteria,omitempty"`

	// Manual specifies the configuration for manual triggers
	Manual *ManualTriggerCriteria `json:"manualCriteria,omitempty"`

	// Webhook specifies the configuration for webhook triggers
	Webhook *WebhookTriggerCriteria `json:"webhookCriteria,omitempty"`

	// Schedule specifies the configuration for scheduled triggers
	Schedule *ScheduleTriggerCriteria `json:"scheduleCriteria,omitempty"`

	// API specifies the configuration for API triggers
	API *APITriggerCriteria `json:"apiCriteria,omitempty"`

	// Workflow specifies the configuration for workflow triggers
	Workflow *WorkflowTriggerCriteria `json:"workflowCriteria,omitempty"`

	// Message specifies the configuration for message triggers
	Message *MessageTriggerCriteria `json:"messageCriteria,omitempty"`
}

TriggerCriteria defines the settings and criteria for configuring triggers

func NewTriggerCriteria

func NewTriggerCriteria() *TriggerCriteria

NewTriggerCriteria creates a new TriggerCriteria with default values

func (*TriggerCriteria) SetDefaultByType

func (ts *TriggerCriteria) SetDefaultByType(strategy TriggerType)

SetDefaultByType applies default values to TriggerCriteria based on trigger type

func (*TriggerCriteria) SetDefaults

func (ts *TriggerCriteria) SetDefaults()

SetDefaults applies default values to TriggerCriteria

type TriggerSettings

type TriggerSettings struct {
	// Type defines the trigger type
	Type TriggerType `json:"strategy,omitempty" validate:"required,oneof=SCHEDULED EVENT POLLING WEBHOOK MANUAL API WORKFLOW MESSAGE BUTTON"`

	// Criteria contains the configuration settings for the trigger
	Criteria *TriggerCriteria `json:"criteria,omitempty"`

	// RetryPolicy specifies the retry behavior for failed triggers
	RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`

	// Description provides additional information about the trigger
	Description string `json:"description,omitempty"`

	// Tags provide searchable metadata for the trigger
	Tags []string `json:"tags,omitempty"`

	// Priority determines the execution priority when multiple triggers fire
	Priority int `json:"priority,omitempty"`
}

TriggerSettings defines the settings for a trigger

func NewTriggerSettings

func NewTriggerSettings() *TriggerSettings

NewTriggerSettings creates a new TriggerSettings with default values

func (*TriggerSettings) SetDefaultByType

func (ts *TriggerSettings) SetDefaultByType(strategy TriggerType)

SetDefaultByType applies default values to TriggerSettings based on trigger type

func (*TriggerSettings) SetDefaults

func (ts *TriggerSettings) SetDefaults()

SetDefaults applies default values to TriggerSettings

type TriggerType

type TriggerType string

TriggerType defines how a workflow can be triggered

const (
	// TriggerTypeScheduled indicates a workflow triggered by a schedule
	TriggerTypeScheduled TriggerType = "SCHEDULED"

	// TriggerTypeEvent indicates a workflow triggered by an event
	TriggerTypeEvent TriggerType = "EVENT"

	// TriggerTypePolling indicates a workflow triggered by polling for changes
	TriggerTypePolling TriggerType = "POLLING"

	// TriggerTypeWebhook indicates a workflow triggered by a webhook
	TriggerTypeWebhook TriggerType = "WEBHOOK"

	// TriggerTypeManual indicates a workflow triggered manually by a user
	TriggerTypeManual TriggerType = "MANUAL"

	// TriggerTypeAPI indicates a workflow triggered via the API
	TriggerTypeAPI TriggerType = "API"

	// TriggerTypeWorkflow indicates a workflow triggered by another workflow
	TriggerTypeWorkflow TriggerType = "WORKFLOW"

	// TriggerTypeMessage indicates a workflow triggered by a message
	TriggerTypeMessage TriggerType = "MESSAGE"

	// TriggerTypeButton indicates a workflow triggered by a button click
	TriggerTypeButton TriggerType = "BUTTON"
)

func TriggerTypeFromString

func TriggerTypeFromString(raw string) (TriggerType, bool)

TriggerTypeFromString determines the enum value with an exact case match

func TriggerTypeFromStringIgnoreCase

func TriggerTypeFromStringIgnoreCase(raw string) (TriggerType, bool)

TriggerTypeFromStringIgnoreCase determines the enum value with a case-insensitive match

func (TriggerType) IsValid

func (_j TriggerType) IsValid() bool

IsValid tests whether the value is a valid enum value

func (TriggerType) MarshalBinary

func (_j TriggerType) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler

func (TriggerType) MarshalGQL

func (_j TriggerType) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler

func (TriggerType) MarshalJSON

func (_j TriggerType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (TriggerType) MarshalText

func (_j TriggerType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (TriggerType) MarshalYAML

func (_j TriggerType) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler

func (TriggerType) RequiresConfiguration

func (t TriggerType) RequiresConfiguration() bool

RequiresConfiguration returns true if the trigger type needs additional configuration

func (TriggerType) SQLTypeName

func (TriggerType) SQLTypeName() string

SQLTypeName returns the SQL type name for serialization

func (*TriggerType) Scan

func (_j *TriggerType) Scan(value interface{}) error

Scan implements sql/driver.Scanner

func (TriggerType) String

func (_j TriggerType) String() string

String returns the string of the enum value

func (TriggerType) SupportsManualTrigger

func (t TriggerType) SupportsManualTrigger() bool

SupportsManualTrigger returns true if the trigger type supports manual triggering

func (TriggerType) SupportsPolling

func (t TriggerType) SupportsPolling() bool

SupportsPolling returns true if the trigger type supports polling

func (TriggerType) SupportsScheduling

func (t TriggerType) SupportsScheduling() bool

SupportsScheduling returns true if the trigger type supports scheduling

func (TriggerType) SupportsWebhook

func (t TriggerType) SupportsWebhook() bool

SupportsWebhook returns true if the trigger type supports webhooks

func (*TriggerType) UnmarshalBinary

func (_j *TriggerType) UnmarshalBinary(text []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler

func (*TriggerType) UnmarshalGQL

func (_j *TriggerType) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements graphql.Unmarshaler

func (*TriggerType) UnmarshalJSON

func (_j *TriggerType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*TriggerType) UnmarshalText

func (_j *TriggerType) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

func (*TriggerType) UnmarshalYAML

func (_j *TriggerType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler

func (TriggerType) Validate

func (_j TriggerType) Validate() error

Validate whether the value is within the range of enum values

func (TriggerType) Values

func (TriggerType) Values() []string

Values returns a slice of all String values of the enum

type WebhookTriggerCriteria

type WebhookTriggerCriteria struct {
	// Endpoint is the URL where the webhook should listen for incoming requests
	Endpoint string `json:"endpoint" validate:"required,url"`

	// HttpMethod specifies the HTTP method for the webhook
	HttpMethod string `json:"httpMethod" validate:"required,oneof=GET POST PUT DELETE"`

	// AuthEnabled determines if the webhook requires authentication
	AuthEnabled bool `json:"authEnabled"`

	// Headers specify required headers that must be included in the webhook requests
	Headers map[string]string `json:"headers,omitempty"`

	// QueryParams define required query parameters for validation
	QueryParams map[string]string `json:"queryParams,omitempty"`

	// ValidationSecret is used to validate webhook requests
	ValidationSecret *string `json:"validationSecret,omitempty"`

	// Enabled determines if the webhook trigger is active
	Enabled bool `json:"enabled" validate:"required"`

	// ResponseTemplate is a template for the webhook response
	ResponseTemplate string `json:"responseTemplate,omitempty"`

	// StatusCode is the HTTP status code to return
	StatusCode int `json:"statusCode,omitempty"`

	// PayloadPath is the path to extract the payload from the request
	PayloadPath string `json:"payloadPath,omitempty"`

	// ContentType is the expected content type of the webhook request
	ContentType string `json:"contentType,omitempty"`
}

WebhookTriggerCriteria defines the criteria for triggering via webhook

func NewWebhookTriggerCriteria

func NewWebhookTriggerCriteria() *WebhookTriggerCriteria

NewWebhookTriggerCriteria creates a new instance of WebhookTriggerCriteria with default values

func (*WebhookTriggerCriteria) SetDefaults

func (c *WebhookTriggerCriteria) SetDefaults()

SetDefaults applies default values for WebhookTriggerCriteria

type WorkflowTriggerCriteria

type WorkflowTriggerCriteria struct {
	// SourceWorkflowID is the ID of the source workflow
	SourceWorkflowID string `json:"sourceWorkflowId,omitempty"`

	// TriggerOnEvents determines which events trigger the workflow
	TriggerOnEvents []string `json:"triggerOnEvents,omitempty"`

	// InputMapping defines how to map source workflow outputs to this workflow inputs
	InputMapping map[string]string `json:"inputMapping,omitempty"`

	// Condition is a condition that must be met for the trigger to fire
	Condition string `json:"condition,omitempty"`

	// Enabled determines if the workflow trigger is active
	Enabled bool `json:"enabled"`
}

WorkflowTriggerCriteria defines criteria for workflow-triggered workflows

func NewWorkflowTriggerCriteria

func NewWorkflowTriggerCriteria() *WorkflowTriggerCriteria

NewWorkflowTriggerCriteria creates a new WorkflowTriggerCriteria with default values

func (*WorkflowTriggerCriteria) SetDefaults

func (c *WorkflowTriggerCriteria) SetDefaults()

SetDefaults applies default values to WorkflowTriggerCriteria

type WriteLogLineOpts

type WriteLogLineOpts struct {
	// The step run id
	ProjectID string `json:"project_id" validate:"required,uuid"`
	// The step run id
	StepRunID *string `json:"step_run_id" validate:"omitnil,uuid"`

	// The flow run id
	FlowID string `json:"flow_id" validate:"uuid"`

	// (optional) The time when the log line was created.
	CreatedAt *time.Time

	// (required) The message of the log line.
	Message string `json:"message" validate:"required,min=1,max=10000"`

	// (optional) The level of the log line.
	Level *string `json:"level" validate:"omitnil,oneof=INFO ERROR WARN DEBUG"`

	// (optional) The metadata of the log line.
	Metadata map[string]any `json:"metadata"`
}

Jump to

Keyboard shortcuts

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