core

package
v0.11.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfiguration = errors.New("invalid configuration")
	ErrDuplicateBranchID    = errors.New("duplicate branch ID")
	ErrInvalidBranchID      = errors.New("invalid or empty branch ID")
)

Error definitions

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

Functions

func AnyToRawJSON added in v0.11.0

func AnyToRawJSON(data any) (json.RawMessage, error)

AnyToRawJSON converts any Go value to a json.RawMessage

func Coalesce added in v0.11.2

func Coalesce[T any](values ...*T) *T

Coalesce returns the first non-nil value from the arguments

func Contains added in v0.11.2

func Contains[T comparable](slice []T, item T) bool

Contains checks if a slice contains a specific value

func DeepCopy

func DeepCopy(data interface{}) interface{}

DeepCopy creates a deep copy of a JSON value

func Deref added in v0.11.2

func Deref[T any](ptr *T) T

Deref dereferences a pointer, returning the zero value if nil

func ExcludeFromMap

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

ExcludeFromMap returns a new map excluding the specified keys

func Filter added in v0.11.2

func Filter[T any](slice []T, predicate func(T) bool) []T

Filter filters a slice based on a predicate function

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 FromJSON added in v0.11.2

func FromJSON[T any](jsonStr string) (*T, error)

FromJSON parses a JSON string into a target type

func GenerateID added in v0.11.2

func GenerateID() string

GenerateID generates a new unique ID

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 GetBoolFromMap added in v0.11.2

func GetBoolFromMap(m map[string]interface{}, key string, defaultValue bool) bool

GetBoolFromMap safely gets a bool value from a map

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 GetIntFromMap added in v0.11.2

func GetIntFromMap(m map[string]interface{}, key string, defaultValue int) int

GetIntFromMap safely gets an int value from a map

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 GetStringFromMap added in v0.11.2

func GetStringFromMap(m map[string]interface{}, key string, defaultValue string) string

GetStringFromMap safely gets a string value from a map

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 InterfaceSliceToStringSlice added in v0.11.2

func InterfaceSliceToStringSlice(interfaces []interface{}) []string

InterfaceSliceToStringSlice converts []interface{} to []string

func Keys added in v0.11.2

func Keys[K comparable, V any](m map[K]V) []K

Keys returns the keys of a map as a slice

func Map added in v0.11.2

func Map[T, U any](slice []T, mapper func(T) U) []U

Map transforms a slice using a mapping function

func MergeJSON

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

MergeJSON merges source JSON into target JSON

func MergeMap added in v0.11.2

func MergeMap(base, override map[string]interface{}) map[string]interface{}

MergeMap merges two maps, with the second map taking precedence

func MergeMaps

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

MergeMaps merges multiple maps into a single map

func Now added in v0.11.2

func Now() string

Now returns the current time as a string in RFC3339 format

func ParseJSONField added in v0.11.2

func ParseJSONField[T any](jsonStr string) (*T, error)

ParseJSONField parses a JSON string field into a map or struct

func ParseJSONPath

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

ParseJSONPath parses a JSON path and validates it

func ParseTextareaLines added in v0.11.2

func ParseTextareaLines(text interface{}) []string

ParseTextareaLines parses textarea input (string with newlines) into a slice of strings

func PrettyPrint added in v0.11.0

func PrettyPrint(data interface{})

func Ptr added in v0.11.2

func Ptr[T any](v T) *T

Ptr returns a pointer to the given value

func RawJSONToAny added in v0.11.0

func RawJSONToAny(raw json.RawMessage) (any, error)

RawJSONToAny converts a json.RawMessage to an any type

func Reduce added in v0.11.2

func Reduce[T, U any](slice []T, initial U, reducer func(U, T) U) U

Reduce reduces a slice to a single value using a reducer function

func RemoveValue

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

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

func SafeBool added in v0.11.2

func SafeBool(v interface{}) bool

SafeBool safely converts any value to bool

func SafeInt added in v0.11.2

func SafeInt(v interface{}) int

SafeInt safely converts any value to int

func SafeString added in v0.11.2

func SafeString(v interface{}) string

SafeString safely converts any value to string

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

func StringSliceToInterfaceSlice added in v0.11.2

func StringSliceToInterfaceSlice(strings []string) []interface{}

StringSliceToInterfaceSlice converts []string to []interface{}

func Ternary added in v0.11.2

func Ternary[T any](condition bool, trueValue, falseValue T) T

Ternary is a ternary operator function

func ToJSONRaw added in v0.11.0

func ToJSONRaw(data any) (json.RawMessage, error)

ToJSONRaw converts any Go value to a raw JSON representation

func ToJSONRawPretty added in v0.11.0

func ToJSONRawPretty(data any) (json.RawMessage, error)

ToJSONRawPretty converts any Go value to a raw JSON representation with indentation

func Values added in v0.11.2

func Values[K comparable, V any](m map[K]V) []V

Values returns the values of a map as a slice

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 {
	// Loop *LoopSettings `json:"loop,omitempty"`
	Branch   *BranchSettings   `json:"_"`
	Router   *RouterSettings   `json:"router,omitempty"`
	Parallel *ParallelSettings `json:"parallel,omitempty"`
}

type ActionType

type ActionType string

ActionType defines the type of action in a workflow.

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

	// ActionTypeDelay represents a standard action.
	ActionTypeDelay ActionType = "DELAY"

	// ActionTypeParallel represents a standard action.
	ActionTypeParallel ActionType = "PARALLEL"

	// ActionTypeSubflow represents a standard action.
	ActionTypeSubflow ActionType = "SUBFLOW"

	// 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"

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

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 `json:"schema"`
	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 BranchSettings added in v0.11.0

type BranchSettings 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 RouteMode `json:"branchMode,omitempty"`

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

BranchSettings defines the configuration for a branching flow step.

func NewBranchSettings

func NewBranchSettings() *BranchSettings

NewBranchSettings creates a new BranchSettings with default values

func (*BranchSettings) AddBranch added in v0.11.0

func (bs *BranchSettings) AddBranch(branch FlowRouter)

AddBranch adds a new branch to the BranchSettings

func (*BranchSettings) GetBranchByID added in v0.11.0

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

GetBranchByID retrieves a branch by its ID

func (*BranchSettings) GetDefaultBranch added in v0.11.0

func (bs *BranchSettings) GetDefaultBranch() *FlowRouter

GetDefaultBranch gets the default branch

func (*BranchSettings) SetDefaultBranch added in v0.11.0

func (bs *BranchSettings) SetDefaultBranch(id string)

SetDefaultBranch sets a branch as the default

type DynamicOptionsFilterParams added in v0.11.0

type DynamicOptionsFilterParams struct {
	Offset     int    `json:"offset"` // The offset of the first item to return (default: 0)
	Limit      int    `json:"limit"`  // The maximum number of items to return (default: 10)
	FilterTerm string `json:"filterTerm"`
}

type DynamicOptionsResponse added in v0.11.0

type DynamicOptionsResponse struct {
	Metadata OffsetPaginationMeta `json:"metadata"`
	Items    any                  `json:"items"`
}

type Environment added in v0.11.0

type Environment string

Environment represents the execution environment

const (
	// EnvironmentTest represents the test environment
	EnvironmentTest Environment = "test"
	// EnvironmentDebug represents the debug environment
	EnvironmentDebug Environment = "debug"
	// EnvironmentProd represents the production environment
	EnvironmentProd Environment = "prod"
	EnvironmentDev  Environment = "dev"
)

func ParseEnvironment added in v0.11.0

func ParseEnvironment(s string) (Environment, error)

ParseEnvironment parses a string into an Environment

func (Environment) IsDebug added in v0.11.0

func (e Environment) IsDebug() bool

IsDebug returns true if the environment is debug

func (Environment) IsProduction added in v0.11.0

func (e Environment) IsProduction() bool

IsProduction returns true if the environment is production

func (Environment) IsTest added in v0.11.0

func (e Environment) IsTest() bool

IsTest returns true if the environment is test

func (Environment) IsValid added in v0.11.0

func (e Environment) IsValid() bool

IsValid checks if the environment is valid

func (Environment) String added in v0.11.0

func (e Environment) String() string

String returns the string representation of the environment

func (Environment) Values added in v0.11.1

func (e Environment) Values() (kinds []string)

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 FlowComponentType added in v0.11.0

type FlowComponentType string

FlowComponentType defines the specific type of flow component

const (
	// FlowComponentTypeBranch represents a branching flow component
	FlowComponentTypeBranch FlowComponentType = "BRANCH"

	// FlowComponentTypeLoop represents a loop flow component
	FlowComponentTypeLoop FlowComponentType = "LOOP"

	// FlowComponentTypeCondition represents a condition flow component
	FlowComponentTypeCondition FlowComponentType = "CONDITION"

	// FlowComponentTypeRouter represents a router flow component
	FlowComponentTypeRouter FlowComponentType = "ROUTER"

	// FlowComponentTypeApproval represents an approval flow component
	FlowComponentTypeApproval FlowComponentType = "APPROVAL"

	// FlowComponentTypeDelay represents a delay flow component
	FlowComponentTypeDelay FlowComponentType = "DELAY"

	// FlowComponentTypeSubflow represents a subflow flow component
	FlowComponentTypeSubflow FlowComponentType = "SUBFLOW"

	// FlowComponentTypeParallel represents a subflow flow component
	FlowComponentTypeParallel FlowComponentType = "PARALLEL"

	FlowComponentTypeSequential FlowComponentType = "SEQUENTIAL"
)

func (*FlowComponentType) Scan added in v0.11.0

func (s *FlowComponentType) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (FlowComponentType) Value added in v0.11.0

func (s FlowComponentType) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

func (FlowComponentType) Values added in v0.11.0

func (FlowComponentType) Values() []string

Values provides list valid values for Enum.

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 any `json:"condition,omitempty"`

	// Value is the expected value for this branch
	// (used with RouteModeValue)
	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"`

	// Description is the description of the branch
	Description string `json:"description,omitempty"`
}

FlowRouter represents a single branch option in a branching flow.

func NewFlowRouter added in v0.11.0

func NewFlowRouter(name string, nextStep string) *FlowRouter

NewFlowRouter creates a new branch with defaults

func (*FlowRouter) AsDefault added in v0.11.0

func (b *FlowRouter) AsDefault() *FlowRouter

AsDefault sets this branch as the default

func (*FlowRouter) WithCondition added in v0.11.0

func (b *FlowRouter) WithCondition(condition string) *FlowRouter

WithCondition adds a condition to the branch

func (*FlowRouter) WithFieldCondition added in v0.11.0

func (b *FlowRouter) WithFieldCondition(field string, operator string, value interface{}) *FlowRouter

WithFieldCondition sets up a field-based condition

func (*FlowRouter) WithOrder added in v0.11.0

func (b *FlowRouter) WithOrder(order int) *FlowRouter

WithOrder sets the order of the branch

func (*FlowRouter) WithValue added in v0.11.0

func (b *FlowRouter) WithValue(value interface{}) *FlowRouter

WithValue adds a value to the branch

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 = "WARN"
	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(level LogLevel, message string, a ...any)
	SetPrefix(prefix string)
	GetLogs() []LogEntry
	ClearLogs()
	Info(message string, keysAndValues ...interface{})
	Infof(message string, a ...any)
	Warn(message string, keysAndValues ...interface{})
	Warnf(message string, a ...any)
	Error(message string, keysAndValues ...interface{})
	Errorf(err error, message string, a ...any)
	Debug(message string, keysAndValues ...interface{})
	Debugf(message string, a ...any)
	WithField(key string, value interface{}) Logger
	WithFields(fields map[string]interface{}) Logger
	Clone() Logger
}

Logger provides a centralized interface for managing logs.

func NewNoopLogger added in v0.11.0

func NewNoopLogger() Logger

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 NoopLogger added in v0.11.0

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

func (*NoopLogger) AddLog added in v0.11.0

func (n *NoopLogger) AddLog(level LogLevel, message string, a ...any)

func (*NoopLogger) AddLogMessage added in v0.11.0

func (n *NoopLogger) AddLogMessage(level LogLevel, message string)

func (*NoopLogger) ClearLogs added in v0.11.0

func (n *NoopLogger) ClearLogs()

func (*NoopLogger) Clone added in v0.11.0

func (n *NoopLogger) Clone() Logger

func (*NoopLogger) Debug added in v0.11.0

func (n *NoopLogger) Debug(message string, keysAndValues ...interface{})

func (*NoopLogger) Debugf added in v0.11.0

func (n *NoopLogger) Debugf(message string, a ...any)

func (*NoopLogger) Error added in v0.11.0

func (n *NoopLogger) Error(err string, keysAndValues ...interface{})

func (*NoopLogger) Errorf added in v0.11.0

func (n *NoopLogger) Errorf(err error, message string, a ...any)

func (*NoopLogger) GetLogs added in v0.11.0

func (n *NoopLogger) GetLogs() []LogEntry

func (*NoopLogger) Info added in v0.11.0

func (n *NoopLogger) Info(message string, keysAndValues ...interface{})

func (*NoopLogger) Infof added in v0.11.0

func (n *NoopLogger) Infof(message string, a ...any)

func (*NoopLogger) SetPrefix added in v0.11.0

func (n *NoopLogger) SetPrefix(prefix string)

func (*NoopLogger) Warn added in v0.11.0

func (n *NoopLogger) Warn(message string, keysAndValues ...interface{})

func (*NoopLogger) Warnf added in v0.11.0

func (n *NoopLogger) Warnf(message string, a ...any)

func (*NoopLogger) WithField added in v0.11.0

func (n *NoopLogger) WithField(key string, value interface{}) Logger

func (*NoopLogger) WithFields added in v0.11.0

func (n *NoopLogger) WithFields(fields map[string]interface{}) Logger

type OffsetPaginationMeta added in v0.11.0

type OffsetPaginationMeta struct {
	Offset     int  `json:"offset"`
	Limit      int  `json:"limit"`
	TotalItems int  `json:"totalItems"`
	HasMore    bool `json:"hasMore"`
}

type ParallelBranch added in v0.11.3

type ParallelBranch 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"`

	// Description describes the branch purpose
	Description string `json:"description,omitempty"`

	// Weight defines the relative importance/priority of this branch
	Weight int `json:"weight,omitempty"`

	// Condition is an optional condition that must be true to execute this branch
	Condition string `json:"condition,omitempty"`

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

	// Timeout defines timeout specific to this branch
	Timeout *time.Duration `json:"timeout,omitempty"`

	// RetryPolicy defines retry behavior specific to this branch
	RetryPolicy *ParallelRetryPolicy `json:"retryPolicy,omitempty"`

	// Required indicates if this branch is required for overall success
	Required bool `json:"required,omitempty"`

	// Order defines execution order (for ordered parallel execution)
	Order int `json:"order,omitempty"`

	// ResourceRequirements defines resource needs for this branch
	ResourceRequirements map[string]interface{} `json:"resourceRequirements,omitempty"`

	// Tags for categorizing and filtering branches
	Tags []string `json:"tags,omitempty"`

	// Metadata for additional branch information
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

ParallelBranch represents a single branch in parallel execution.

type ParallelCallback added in v0.11.3

type ParallelCallback struct {
	// Expression to evaluate
	Expression string `json:"expression,omitempty"`

	// NextStep to execute
	NextStep string `json:"nextStep,omitempty"`

	// NotificationSettings for sending notifications
	NotificationSettings map[string]interface{} `json:"notificationSettings,omitempty"`
}

ParallelCallback defines callback actions for parallel execution events.

type ParallelErrorHandling added in v0.11.3

type ParallelErrorHandling string

ParallelErrorHandling defines how to handle errors in parallel execution.

const (
	// ErrorHandlingFailFast stops all execution on first error
	ErrorHandlingFailFast ParallelErrorHandling = "fail_fast"

	// ErrorHandlingContinue continues execution despite errors
	ErrorHandlingContinue ParallelErrorHandling = "continue"

	// ErrorHandlingCollect collects all errors and fails at the end
	ErrorHandlingCollect ParallelErrorHandling = "collect"

	// ErrorHandlingPartial allows partial success with some failures
	ErrorHandlingPartial ParallelErrorHandling = "partial"
)

type ParallelPriority added in v0.11.3

type ParallelPriority string

ParallelPriority defines execution priority settings.

const (
	// PriorityHigh for high priority execution
	PriorityHigh ParallelPriority = "high"

	// PriorityNormal for normal priority execution
	PriorityNormal ParallelPriority = "normal"

	// PriorityLow for low priority execution
	PriorityLow ParallelPriority = "low"

	// PriorityWeighted for weight-based priority execution
	PriorityWeighted ParallelPriority = "weighted"
)

type ParallelResultHandling added in v0.11.3

type ParallelResultHandling string

ParallelResultHandling defines how to handle and aggregate results.

const (
	// ResultHandlingMerge merges all results into a single output
	ResultHandlingMerge ParallelResultHandling = "merge"

	// ResultHandlingArray collects results as an array
	ResultHandlingArray ParallelResultHandling = "array"

	// ResultHandlingMap collects results as a keyed map
	ResultHandlingMap ParallelResultHandling = "map"

	// ResultHandlingFirst returns only the first successful result
	ResultHandlingFirst ParallelResultHandling = "first"
)

type ParallelRetryPolicy added in v0.11.3

type ParallelRetryPolicy struct {
	// MaxAttempts defines maximum retry attempts
	MaxAttempts int `json:"maxAttempts,omitempty"`

	// BackoffType defines the backoff strategy
	BackoffType string `json:"backoffType,omitempty"` // linear, exponential, fixed

	// InitialDelay is the initial delay before first retry
	InitialDelay time.Duration `json:"initialDelay,omitempty"`

	// MaxDelay is the maximum delay between retries
	MaxDelay time.Duration `json:"maxDelay,omitempty"`

	// BackoffMultiplier for exponential backoff
	BackoffMultiplier float64 `json:"backoffMultiplier,omitempty"`

	// RetriableErrors defines which errors should trigger a retry
	RetriableErrors []string `json:"retriableErrors,omitempty"`

	// NonRetriableErrors defines which errors should not trigger a retry
	NonRetriableErrors []string `json:"nonRetriableErrors,omitempty"`
}

ParallelRetryPolicy defines retry behavior for parallel branches.

type ParallelSettings added in v0.11.3

type ParallelSettings struct {
	Type ParallelType `json:"type,omitempty"`

	// MaxConcurrency limits the maximum number of concurrent executions
	// 0 means unlimited (use with caution)
	MaxConcurrency int `json:"maxConcurrency,omitempty"`

	// BatchSize defines the number of branches to execute per batch (for batch type)
	BatchSize int `json:"batchSize,omitempty"`

	// ThrottleRate defines the rate limit for throttled execution (executions per second)
	ThrottleRate float64 `json:"throttleRate,omitempty"`

	// Timeout defines the maximum time to wait for all branches to complete
	Timeout *time.Duration `json:"timeout,omitempty"`

	// ErrorHandling defines how to handle errors during parallel execution
	ErrorHandling ParallelErrorHandling `json:"errorHandling,omitempty"`

	// ResultHandling defines how to aggregate and return results
	ResultHandling ParallelResultHandling `json:"resultHandling,omitempty"`

	// WaitForAll determines if we should wait for all branches to complete
	// (only applies to certain types)
	WaitForAll bool `json:"waitForAll,omitempty"`

	// FailOnError determines if the entire parallel execution should fail on any error
	FailOnError bool `json:"failOnError,omitempty"`

	// MinSuccessCount defines minimum successful branches required for overall success
	MinSuccessCount int `json:"minSuccessCount,omitempty"`

	// MaxFailureCount defines maximum failures allowed before stopping
	MaxFailureCount int `json:"maxFailureCount,omitempty"`

	// RetryPolicy defines retry behavior for failed branches
	RetryPolicy *ParallelRetryPolicy `json:"retryPolicy,omitempty"`

	// Priority defines execution priority for branches
	Priority ParallelPriority `json:"priority,omitempty"`

	// EnableLoadBalancing enables automatic load balancing across available resources
	EnableLoadBalancing bool `json:"enableLoadBalancing,omitempty"`

	// ResourceConstraints defines resource limits for parallel execution
	ResourceConstraints *ResourceConstraints `json:"resourceConstraints,omitempty"`

	// CollectMetrics determines if execution metrics should be collected
	CollectMetrics bool `json:"collectMetrics,omitempty"`

	// EnableTracing enables distributed tracing for parallel branches
	EnableTracing bool `json:"enableTracing,omitempty"`

	// BranchTimeout defines timeout for individual branches
	BranchTimeout *time.Duration `json:"branchTimeout,omitempty"`

	// Branches defines the parallel execution branches
	Branches []ParallelBranch `json:"branches,omitempty"`

	// PreCondition is an expression that must evaluate to true before parallel execution
	PreCondition string `json:"preCondition,omitempty"`

	// PostCondition is an expression to evaluate after parallel execution
	PostCondition string `json:"postCondition,omitempty"`

	// OnSuccess defines actions to take when parallel execution succeeds
	OnSuccess *ParallelCallback `json:"onSuccess,omitempty"`

	// OnFailure defines actions to take when parallel execution fails
	OnFailure *ParallelCallback `json:"onFailure,omitempty"`

	// OnPartialSuccess defines actions to take when some branches succeed
	OnPartialSuccess *ParallelCallback `json:"onPartialSuccess,omitempty"`
}

ParallelSettings defines the configuration for parallel flow execution.

func NewParallelSettings added in v0.11.3

func NewParallelSettings() *ParallelSettings

NewParallelSettings creates a new ParallelSettings with default values.

func (*ParallelSettings) AddBranch added in v0.11.3

func (ps *ParallelSettings) AddBranch(branch ParallelBranch)

AddBranch adds a new branch to the ParallelSettings.

func (*ParallelSettings) GetBranchByID added in v0.11.3

func (ps *ParallelSettings) GetBranchByID(id string) *ParallelBranch

GetBranchByID retrieves a branch by its ID.

func (*ParallelSettings) GetBranchesByTag added in v0.11.3

func (ps *ParallelSettings) GetBranchesByTag(tags ...string) []ParallelBranch

GetBranchesByTag returns branches that have any of the specified tags.

func (*ParallelSettings) GetRequiredBranches added in v0.11.3

func (ps *ParallelSettings) GetRequiredBranches() []ParallelBranch

GetRequiredBranches returns all branches marked as required.

func (*ParallelSettings) SetResourceConstraints added in v0.11.3

func (ps *ParallelSettings) SetResourceConstraints(constraints *ResourceConstraints)

SetResourceConstraints sets resource constraints for the parallel execution.

func (*ParallelSettings) SetRetryPolicy added in v0.11.3

func (ps *ParallelSettings) SetRetryPolicy(policy *ParallelRetryPolicy)

SetRetryPolicy sets the default retry policy for all branches.

func (*ParallelSettings) Validate added in v0.11.3

func (ps *ParallelSettings) Validate() error

Validate validates the parallel settings configuration.

type ParallelType added in v0.11.3

type ParallelType string

ParallelType defines the type of parallel execution.

const (
	// ParallelTypeAll executes all branches simultaneously and waits for all to complete
	ParallelTypeAll ParallelType = "all"

	// ParallelTypeRace executes all branches simultaneously but returns on first completion
	ParallelTypeRace ParallelType = "race"

	// ParallelTypeBatch executes branches in batches with configurable batch size
	ParallelTypeBatch ParallelType = "batch"

	// ParallelTypeThrottled executes branches with rate limiting
	ParallelTypeThrottled ParallelType = "throttled"
)

type PollingTriggerCriteria

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

	// MinInterval defines the duration between each poll
	MinInterval time.Duration `json:"minInterval" validate:"required,gt=0"`

	// MaxInterval defines the duration between each poll
	MaxInterval time.Duration `json:"maxInterval" 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 ResourceConstraints added in v0.11.3

type ResourceConstraints struct {
	// MaxMemory defines maximum memory usage (in bytes)
	MaxMemory int64 `json:"maxMemory,omitempty"`

	// MaxCPU defines maximum CPU usage (as percentage)
	MaxCPU float64 `json:"maxCPU,omitempty"`

	// MaxDiskIO defines maximum disk I/O usage
	MaxDiskIO int64 `json:"maxDiskIO,omitempty"`

	// MaxNetworkIO defines maximum network I/O usage
	MaxNetworkIO int64 `json:"maxNetworkIO,omitempty"`

	// MaxExecutionTime defines maximum total execution time
	MaxExecutionTime *time.Duration `json:"maxExecutionTime,omitempty"`
}

ResourceConstraints defines resource limits for parallel execution.

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"`

	BackoffFactor float64 `json:"backoffFactor"`

	// 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 RouteMode added in v0.11.3

type RouteMode string

RouteMode defines how branches in a workflow are selected.

const (
	// RouteModeExpression uses a JavaScript expression to determine the branch
	RouteModeExpression RouteMode = "expression"

	// RouteModeCondition uses field-based condition matching
	RouteModeCondition RouteMode = "condition"

	// RouteModeValue uses direct value matching
	RouteModeValue RouteMode = "value"
)

type RouterSettings

type RouterSettings struct {
	Type RouterType `json:"type,omitempty"`

	// DefaultRoute specifies which branch to follow when no condition is met
	DefaultRoute string `json:"defaultRoute,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"`

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

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

RouterSettings defines the configuration for a branching flow step.

func NewRouterSettings added in v0.11.0

func NewRouterSettings() *RouterSettings

NewRouterSettings creates a new BranchSettings with default values

func (*RouterSettings) AddRoute added in v0.11.3

func (bs *RouterSettings) AddRoute(branch FlowRouter)

AddRoute adds a new branch to the RouterSettings

func (*RouterSettings) GetDefaultRoute added in v0.11.3

func (bs *RouterSettings) GetDefaultRoute() *FlowRouter

GetDefaultRoute gets the default branch

func (*RouterSettings) GetRouteByID added in v0.11.3

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

GetRouteByID retrieves a branch by its ID

func (*RouterSettings) SetDefaultBranch

func (bs *RouterSettings) SetDefaultBranch(id string)

SetDefaultBranch sets a branch as the default

type RouterType added in v0.11.0

type RouterType string

RouterType defines the type of router.

const (
	// RouterTypeSwitch routes based on evaluating an expression and matching the result.
	RouterTypeSwitch RouterType = "switch"

	// RouterTypeCondition routes based on evaluating multiple conditions and taking the first match.
	RouterTypeCondition RouterType = "condition"

	// RouterTypeMultiPath allows taking multiple paths if their conditions are true.
	RouterTypeMultiPath RouterType = "multipath"
)

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"`

	Interval *time.Duration `json:"interval,omitempty"`

	// 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"

	// StepRunStatusCompleted indicates a step has completed successfully
	StepRunStatusCompleted StepRunStatus = "COMPLETED"

	// 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"

	StepRunStatusRetrying StepRunStatus = "RETRY"
)

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) CanTransitionTo added in v0.11.3

func (s StepRunStatus) CanTransitionTo(target StepRunStatus) bool

CanTransitionTo checks if a transition to the target status is valid

func (StepRunStatus) IsActive

func (s StepRunStatus) IsActive() bool

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

func (StepRunStatus) IsActive2 added in v0.11.3

func (s StepRunStatus) IsActive2() bool

IsActive returns true if the status represents an active/running state

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) IsTerminal added in v0.11.3

func (s StepRunStatus) IsTerminal() bool

IsTerminal returns true if the status represents a terminal state

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"`

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

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

	// Deduplicate determines if duplicate events should be filtered
	Filters map[string]any `json:"filters,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"

	TriggerTypePubsub TriggerType = "PUBSUB"

	// 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) GetDefaultRetryPolicy added in v0.11.2

func (t TriggerType) GetDefaultRetryPolicy() *RetryPolicy

GetDefaultRetryPolicy returns the default retry policy for the trigger type

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) RequiresExternalService added in v0.11.2

func (t TriggerType) RequiresExternalService() bool

RequiresExternalService returns true if the trigger type requires an external service

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) SupportsBatching added in v0.11.2

func (t TriggerType) SupportsBatching() bool

SupportsBatching returns true if the trigger type supports batching multiple events

func (TriggerType) SupportsFiltering added in v0.11.2

func (t TriggerType) SupportsFiltering() bool

SupportsFiltering returns true if the trigger type supports message/event filtering

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"`

	BasePath     string `json:"basePath,omitempty"`
	SecretHeader string `json:"secretHeader,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"`

	Timeout time.Duration `json:"timeout,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