Documentation
¶
Index ¶
- Constants
- func Read(data []byte) (flows.Action, error)
- func RegisteredTypes() map[string](func() flows.Action)
- type AddContactGroups
- func (a *AddContactGroups) AllowedFlowTypes() []flows.FlowType
- func (a *AddContactGroups) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *AddContactGroups) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *AddContactGroups) LocalizationUUID() uuids.UUID
- func (a *AddContactGroups) Type() string
- func (a *AddContactGroups) UUID() flows.ActionUUID
- func (a *AddContactGroups) Validate() error
- type AddContactURN
- func (a *AddContactURN) AllowedFlowTypes() []flows.FlowType
- func (a *AddContactURN) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *AddContactURN) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *AddContactURN) LocalizationUUID() uuids.UUID
- func (a *AddContactURN) Type() string
- func (a *AddContactURN) UUID() flows.ActionUUID
- func (a *AddContactURN) Validate() error
- type AddInputLabels
- func (a *AddInputLabels) AllowedFlowTypes() []flows.FlowType
- func (a *AddInputLabels) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *AddInputLabels) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *AddInputLabels) LocalizationUUID() uuids.UUID
- func (a *AddInputLabels) Type() string
- func (a *AddInputLabels) UUID() flows.ActionUUID
- func (a *AddInputLabels) Validate() error
- type CallClassifier
- func (a *CallClassifier) AllowedFlowTypes() []flows.FlowType
- func (a *CallClassifier) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *CallClassifier) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *CallClassifier) LocalizationUUID() uuids.UUID
- func (a *CallClassifier) Type() string
- func (a *CallClassifier) UUID() flows.ActionUUID
- func (a *CallClassifier) Validate() error
- type CallLLM
- func (a *CallLLM) AllowedFlowTypes() []flows.FlowType
- func (a *CallLLM) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *CallLLM) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *CallLLM) LocalizationUUID() uuids.UUID
- func (a *CallLLM) Type() string
- func (a *CallLLM) UUID() flows.ActionUUID
- func (a *CallLLM) Validate() error
- type CallResthook
- func (a *CallResthook) AllowedFlowTypes() []flows.FlowType
- func (a *CallResthook) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *CallResthook) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *CallResthook) LocalizationUUID() uuids.UUID
- func (a *CallResthook) Type() string
- func (a *CallResthook) UUID() flows.ActionUUID
- func (a *CallResthook) Validate() error
- type CallWebhook
- func (a *CallWebhook) AllowedFlowTypes() []flows.FlowType
- func (a *CallWebhook) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *CallWebhook) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *CallWebhook) LocalizationUUID() uuids.UUID
- func (a *CallWebhook) Type() string
- func (a *CallWebhook) UUID() flows.ActionUUID
- func (a *CallWebhook) Validate() error
- type EnterFlow
- func (a *EnterFlow) AllowedFlowTypes() []flows.FlowType
- func (a *EnterFlow) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *EnterFlow) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *EnterFlow) LocalizationUUID() uuids.UUID
- func (a *EnterFlow) Type() string
- func (a *EnterFlow) UUID() flows.ActionUUID
- func (a *EnterFlow) Validate() error
- type LocalOperation
- type OpenTicket
- func (a *OpenTicket) AllowedFlowTypes() []flows.FlowType
- func (a *OpenTicket) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *OpenTicket) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *OpenTicket) LocalizationUUID() uuids.UUID
- func (a *OpenTicket) Type() string
- func (a *OpenTicket) UUID() flows.ActionUUID
- func (a *OpenTicket) Validate() error
- type PlayAudio
- func (a *PlayAudio) AllowedFlowTypes() []flows.FlowType
- func (a *PlayAudio) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *PlayAudio) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *PlayAudio) LocalizationUUID() uuids.UUID
- func (a *PlayAudio) Type() string
- func (a *PlayAudio) UUID() flows.ActionUUID
- func (a *PlayAudio) Validate() error
- type RemoveContactGroups
- func (a *RemoveContactGroups) AllowedFlowTypes() []flows.FlowType
- func (a *RemoveContactGroups) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *RemoveContactGroups) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *RemoveContactGroups) LocalizationUUID() uuids.UUID
- func (a *RemoveContactGroups) Type() string
- func (a *RemoveContactGroups) UUID() flows.ActionUUID
- func (a *RemoveContactGroups) Validate() error
- type RequestOptIn
- func (a *RequestOptIn) AllowedFlowTypes() []flows.FlowType
- func (a *RequestOptIn) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *RequestOptIn) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *RequestOptIn) LocalizationUUID() uuids.UUID
- func (a *RequestOptIn) Type() string
- func (a *RequestOptIn) UUID() flows.ActionUUID
- func (a *RequestOptIn) Validate() error
- type SayMsg
- func (a *SayMsg) AllowedFlowTypes() []flows.FlowType
- func (a *SayMsg) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SayMsg) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SayMsg) LocalizationUUID() uuids.UUID
- func (a *SayMsg) Type() string
- func (a *SayMsg) UUID() flows.ActionUUID
- func (a *SayMsg) Validate() error
- type SendBroadcast
- func (a *SendBroadcast) AllowedFlowTypes() []flows.FlowType
- func (a *SendBroadcast) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SendBroadcast) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SendBroadcast) LocalizationUUID() uuids.UUID
- func (a *SendBroadcast) Type() string
- func (a *SendBroadcast) UUID() flows.ActionUUID
- func (a *SendBroadcast) Validate() error
- type SendEmail
- func (a *SendEmail) AllowedFlowTypes() []flows.FlowType
- func (a *SendEmail) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SendEmail) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SendEmail) LocalizationUUID() uuids.UUID
- func (a *SendEmail) Type() string
- func (a *SendEmail) UUID() flows.ActionUUID
- func (a *SendEmail) Validate() error
- type SendMsg
- func (a *SendMsg) AllowedFlowTypes() []flows.FlowType
- func (a *SendMsg) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SendMsg) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SendMsg) LocalizationUUID() uuids.UUID
- func (a *SendMsg) Type() string
- func (a *SendMsg) UUID() flows.ActionUUID
- func (a *SendMsg) Validate() error
- type SetContactChannel
- func (a *SetContactChannel) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactChannel) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetContactChannel) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetContactChannel) LocalizationUUID() uuids.UUID
- func (a *SetContactChannel) Type() string
- func (a *SetContactChannel) UUID() flows.ActionUUID
- func (a *SetContactChannel) Validate() error
- type SetContactField
- func (a *SetContactField) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactField) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetContactField) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetContactField) LocalizationUUID() uuids.UUID
- func (a *SetContactField) Type() string
- func (a *SetContactField) UUID() flows.ActionUUID
- func (a *SetContactField) Validate() error
- type SetContactLanguage
- func (a *SetContactLanguage) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactLanguage) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetContactLanguage) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetContactLanguage) LocalizationUUID() uuids.UUID
- func (a *SetContactLanguage) Type() string
- func (a *SetContactLanguage) UUID() flows.ActionUUID
- func (a *SetContactLanguage) Validate() error
- type SetContactName
- func (a *SetContactName) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactName) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetContactName) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetContactName) LocalizationUUID() uuids.UUID
- func (a *SetContactName) Type() string
- func (a *SetContactName) UUID() flows.ActionUUID
- func (a *SetContactName) Validate() error
- type SetContactStatus
- func (a *SetContactStatus) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactStatus) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetContactStatus) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetContactStatus) LocalizationUUID() uuids.UUID
- func (a *SetContactStatus) Type() string
- func (a *SetContactStatus) UUID() flows.ActionUUID
- func (a *SetContactStatus) Validate() error
- type SetContactTimezone
- func (a *SetContactTimezone) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactTimezone) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetContactTimezone) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetContactTimezone) LocalizationUUID() uuids.UUID
- func (a *SetContactTimezone) Type() string
- func (a *SetContactTimezone) UUID() flows.ActionUUID
- func (a *SetContactTimezone) Validate() error
- type SetRunLocal
- func (a *SetRunLocal) AllowedFlowTypes() []flows.FlowType
- func (a *SetRunLocal) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetRunLocal) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetRunLocal) LocalizationUUID() uuids.UUID
- func (a *SetRunLocal) Type() string
- func (a *SetRunLocal) UUID() flows.ActionUUID
- func (a *SetRunLocal) Validate() error
- type SetRunResult
- func (a *SetRunResult) AllowedFlowTypes() []flows.FlowType
- func (a *SetRunResult) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *SetRunResult) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *SetRunResult) LocalizationUUID() uuids.UUID
- func (a *SetRunResult) Type() string
- func (a *SetRunResult) UUID() flows.ActionUUID
- func (a *SetRunResult) Validate() error
- type StartSession
- func (a *StartSession) AllowedFlowTypes() []flows.FlowType
- func (a *StartSession) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *StartSession) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *StartSession) LocalizationUUID() uuids.UUID
- func (a *StartSession) Type() string
- func (a *StartSession) UUID() flows.ActionUUID
- func (a *StartSession) Validate() error
- type TransferAirtime
- func (a *TransferAirtime) AllowedFlowTypes() []flows.FlowType
- func (a *TransferAirtime) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
- func (a *TransferAirtime) Inspect(dependency func(assets.Reference), local func(string), ...)
- func (a *TransferAirtime) LocalizationUUID() uuids.UUID
- func (a *TransferAirtime) Type() string
- func (a *TransferAirtime) UUID() flows.ActionUUID
- func (a *TransferAirtime) Validate() error
Constants ¶
const ( CategorySuccess = "Success" CategorySkipped = "Skipped" CategoryFailure = "Failure" )
common category names
const ( // TypeOpenTicket is the type for the open ticket action TypeOpenTicket string = "open_ticket" OpenTicketOutputLocal = "_new_ticket" )
const ( // TypeTransferAirtime is the type for the transfer airtime action TypeTransferAirtime string = "transfer_airtime" TransferAirtimeOutputLocal = "_new_transfer" )
const LLMErrorOutput = "<ERROR>"
LLMErrorOutput is the output used when the LLM call fails
const ResthookPayload = `` /* 928-byte string literal not displayed */
ResthookPayload is the POST payload used by resthooks
const TypeAddContactGroups string = "add_contact_groups"
TypeAddContactGroups is our type for the add to groups action
const TypeAddContactURN string = "add_contact_urn"
TypeAddContactURN is our type for the add URN action
const TypeAddInputLabels string = "add_input_labels"
TypeAddInputLabels is the type for the add label action
const TypeCallClassifier string = "call_classifier"
TypeCallClassifier is the type for the call classifier action
const TypeCallLLM string = "call_llm"
TypeCallLLM is the type for the call LLM action
const TypeCallResthook string = "call_resthook"
TypeCallResthook is the type for the call resthook action
const TypeCallWebhook string = "call_webhook"
TypeCallWebhook is the type for the call webhook action
const TypeEnterFlow string = "enter_flow"
TypeEnterFlow is the type for the enter flow action
const TypePlayAudio string = "play_audio"
TypePlayAudio is the type for the play audio action
const TypeRemoveContactGroups string = "remove_contact_groups"
TypeRemoveContactGroups is the type for the remove from groups action
const TypeRequestOptIn string = "request_optin"
TypeRequestOptIn is the type for the send optin action
const TypeSayMsg string = "say_msg"
TypeSayMsg is the type for the say message action
const TypeSendBroadcast string = "send_broadcast"
TypeSendBroadcast is the type for the send broadcast action
const TypeSendEmail string = "send_email"
TypeSendEmail is the type for the send email action
const TypeSendMsg string = "send_msg"
TypeSendMsg is the type for the send message action
const TypeSetContactChannel string = "set_contact_channel"
TypeSetContactChannel is the type for the set contact channel action
const TypeSetContactField string = "set_contact_field"
TypeSetContactField is the type for the set contact field action
const TypeSetContactLanguage string = "set_contact_language"
TypeSetContactLanguage is the type for the set contact Language action
const TypeSetContactName string = "set_contact_name"
TypeSetContactName is the type for the set contact name action
const TypeSetContactStatus string = "set_contact_status"
TypeSetContactStatus is the type for the set contact status action
const TypeSetContactTimezone string = "set_contact_timezone"
TypeSetContactTimezone is the type for the set contact timezone action
const TypeSetRunLocal string = "set_run_local"
TypeSetRunLocal is the type for the set run result action
const TypeSetRunResult string = "set_run_result"
TypeSetRunResult is the type for the set run result action
const TypeStartSession string = "start_session"
TypeStartSession is the type for the start session action
Variables ¶
This section is empty.
Functions ¶
func RegisteredTypes ¶ added in v0.23.0
RegisteredTypes gets the registered types of action
Types ¶
type AddContactGroups ¶ added in v0.249.0
type AddContactGroups struct {
Groups []*assets.GroupReference `json:"groups" validate:"required,max=100,dive"`
// contains filtered or unexported fields
}
AddContactGroups can be used to add a contact to one or more groups. A [event:contact_groups_changed] event will be created for the groups which the contact has been added to.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "add_contact_groups",
"groups": [{
"uuid": "1e1ce1e1-9288-4504-869e-022d1003c72a",
"name": "Customers"
}]
}
@action add_contact_groups
func NewAddContactGroups ¶ added in v0.48.0
func NewAddContactGroups(uuid flows.ActionUUID, groups []*assets.GroupReference) *AddContactGroups
NewAddContactGroups creates a new add to groups action
func (*AddContactGroups) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*AddContactGroups) Execute ¶ added in v0.249.0
func (a *AddContactGroups) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute adds our contact to the specified groups
func (*AddContactGroups) Inspect ¶ added in v0.249.0
func (a *AddContactGroups) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*AddContactGroups) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*AddContactGroups) Type ¶ added in v0.249.0
func (a *AddContactGroups) Type() string
Type returns the type of this action
func (*AddContactGroups) UUID ¶ added in v0.249.0
func (a *AddContactGroups) UUID() flows.ActionUUID
UUID returns the UUID of the action
type AddContactURN ¶ added in v0.249.0
type AddContactURN struct {
Scheme string `json:"scheme" validate:"urnscheme"`
Path string `json:"path" validate:"required" engine:"evaluated"`
// contains filtered or unexported fields
}
AddContactURN can be used to add a URN to the current contact. A [event:contact_urns_changed] event will be created when this action is encountered.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "add_contact_urn",
"scheme": "tel",
"path": "@results.phone_number.value"
}
@action add_contact_urn
func NewAddContactURN ¶ added in v0.48.0
func NewAddContactURN(uuid flows.ActionUUID, scheme string, path string) *AddContactURN
NewAddContactURN creates a new add URN action
func (*AddContactURN) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*AddContactURN) Execute ¶ added in v0.249.0
func (a *AddContactURN) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs the labeling action
func (*AddContactURN) Inspect ¶ added in v0.249.0
func (a *AddContactURN) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*AddContactURN) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*AddContactURN) Type ¶ added in v0.249.0
func (a *AddContactURN) Type() string
Type returns the type of this action
func (*AddContactURN) UUID ¶ added in v0.249.0
func (a *AddContactURN) UUID() flows.ActionUUID
UUID returns the UUID of the action
type AddInputLabels ¶ added in v0.249.0
type AddInputLabels struct {
Labels []*assets.LabelReference `json:"labels" validate:"required,max=100,dive"`
// contains filtered or unexported fields
}
AddInputLabels can be used to add labels to the last user input on a flow. An [event:input_labels_added] event will be created with the labels added when this action is encountered. If there is no user input at that point then this action will be ignored.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "add_input_labels",
"labels": [{
"uuid": "3f65d88a-95dc-4140-9451-943e94e06fea",
"name": "Spam"
}]
}
@action add_input_labels
func NewAddInputLabels ¶ added in v0.48.0
func NewAddInputLabels(uuid flows.ActionUUID, labels []*assets.LabelReference) *AddInputLabels
NewAddInputLabels creates a new add labels action
func (*AddInputLabels) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*AddInputLabels) Execute ¶ added in v0.249.0
func (a *AddInputLabels) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs the labeling action
func (*AddInputLabels) Inspect ¶ added in v0.249.0
func (a *AddInputLabels) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*AddInputLabels) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*AddInputLabels) Type ¶ added in v0.249.0
func (a *AddInputLabels) Type() string
Type returns the type of this action
func (*AddInputLabels) UUID ¶ added in v0.249.0
func (a *AddInputLabels) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallClassifier ¶ added in v0.249.0
type CallClassifier struct {
Classifier *assets.ClassifierReference `json:"classifier" validate:"required"`
Input string `json:"input" validate:"required" engine:"evaluated"`
ResultName string `json:"result_name" validate:"required,result_name"`
// contains filtered or unexported fields
}
CallClassifier can be used to classify the intent and entities from a given input using an NLU classifier. It always saves a result indicating whether the classification was successful, skipped or failed, and what the extracted intents and entities were.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "call_classifier",
"classifier": {
"uuid": "1c06c884-39dd-4ce4-ad9f-9a01cbe6c000",
"name": "Booking"
},
"input": "@input.text",
"result_name": "Intent"
}
@action call_classifier
func NewCallClassifier ¶ added in v0.51.0
func NewCallClassifier(uuid flows.ActionUUID, classifier *assets.ClassifierReference, input string, resultName string) *CallClassifier
NewCallClassifier creates a new call classifier action
func (*CallClassifier) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallClassifier) Execute ¶ added in v0.249.0
func (a *CallClassifier) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*CallClassifier) Inspect ¶ added in v0.249.0
func (a *CallClassifier) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*CallClassifier) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallClassifier) Type ¶ added in v0.249.0
func (a *CallClassifier) Type() string
Type returns the type of this action
func (*CallClassifier) UUID ¶ added in v0.249.0
func (a *CallClassifier) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallLLM ¶ added in v0.249.0
type CallLLM struct {
LLM *assets.LLMReference `json:"llm" validate:"required"`
Instructions string `json:"instructions" validate:"required" engine:"evaluated"`
Input string `json:"input" engine:"evaluated"`
OutputLocal string `json:"output_local" validate:"required,local_ref"`
// contains filtered or unexported fields
}
CallLLM can be used to call an LLM.
An [event:llm_called] event will be created if the LLM could be called.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "call_llm",
"llm": {
"uuid": "14115c03-b4c5-49e2-b9ac-390c43e9d7ce",
"name": "GPT-4"
},
"instructions": "Categorize the following text as positive or negative",
"input": "@input.text",
"output_local": "_llm_output"
}
@action call_llm
func NewCallLLM ¶ added in v0.235.0
func NewCallLLM(uuid flows.ActionUUID, llm *assets.LLMReference, instructions, input, outputLocal string) *CallLLM
NewCallLLM creates a new call LLM action
func (*CallLLM) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallLLM) Execute ¶ added in v0.249.0
func (a *CallLLM) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*CallLLM) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallLLM) Type ¶ added in v0.249.0
func (a *CallLLM) Type() string
Type returns the type of this action
func (*CallLLM) UUID ¶ added in v0.249.0
func (a *CallLLM) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallResthook ¶ added in v0.249.0
type CallResthook struct {
Resthook string `json:"resthook" validate:"required"`
ResultName string `json:"result_name,omitempty" validate:"omitempty,result_name"`
// contains filtered or unexported fields
}
CallResthook can be used to call a resthook.
A [event:webhook_called] event will be created for each subscriber of the resthook with the results of the HTTP call. If the action has `result_name` set, a result will be created with that name, and if the resthook returns valid JSON, that will be accessible through `extra` on the result.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "call_resthook",
"resthook": "new-registration"
}
@action call_resthook
func NewCallResthook ¶ added in v0.48.0
func NewCallResthook(uuid flows.ActionUUID, resthook string, resultName string) *CallResthook
NewCallResthook creates a new call resthook action
func (*CallResthook) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallResthook) Execute ¶ added in v0.249.0
func (a *CallResthook) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*CallResthook) Inspect ¶ added in v0.249.0
func (a *CallResthook) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*CallResthook) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallResthook) Type ¶ added in v0.249.0
func (a *CallResthook) Type() string
Type returns the type of this action
func (*CallResthook) UUID ¶ added in v0.249.0
func (a *CallResthook) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallWebhook ¶ added in v0.249.0
type CallWebhook struct {
Method string `json:"method" validate:"required,http_method"`
URL string `json:"url" engine:"evaluated" validate:"required"`
Headers map[string]string `json:"headers,omitempty" engine:"evaluated"`
Body string `json:"body,omitempty" engine:"evaluated"`
ResultName string `json:"result_name,omitempty" validate:"omitempty,result_name"`
// contains filtered or unexported fields
}
CallWebhook can be used to call an external service. The body, header and url fields may be templates and will be evaluated at runtime. A [event:webhook_called] event will be created based on the results of the HTTP call. If this action has a `result_name`, then additionally it will create a new result with that name. The value of the result will be the status code and the category will be `Success` or `Failed`. If the webhook returned valid JSON which is less than 10000 bytes, that will be accessible through `extra` on the result. The last JSON response from a webhook call in the current sprint will additionally be accessible in expressions as `@webhook` regardless of size.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "call_webhook",
"method": "GET",
"url": "http://localhost:49998/?cmd=success",
"headers": {
"Authorization": "Token AAFFZZHH"
},
"result_name": "webhook"
}
@action call_webhook
func NewCallWebhook ¶ added in v0.48.0
func NewCallWebhook(uuid flows.ActionUUID, method string, url string, headers map[string]string, body string, resultName string) *CallWebhook
NewCallWebhook creates a new call webhook action
func (*CallWebhook) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallWebhook) Execute ¶ added in v0.249.0
func (a *CallWebhook) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*CallWebhook) Inspect ¶ added in v0.249.0
func (a *CallWebhook) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*CallWebhook) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallWebhook) Type ¶ added in v0.249.0
func (a *CallWebhook) Type() string
Type returns the type of this action
func (*CallWebhook) UUID ¶ added in v0.249.0
func (a *CallWebhook) UUID() flows.ActionUUID
UUID returns the UUID of the action
func (*CallWebhook) Validate ¶ added in v0.249.0
func (a *CallWebhook) Validate() error
Validate validates our action is valid
type EnterFlow ¶ added in v0.249.0
type EnterFlow struct {
Flow *assets.FlowReference `json:"flow" validate:"required"`
Terminal bool `json:"terminal,omitempty"`
// contains filtered or unexported fields
}
EnterFlow can be used to start a contact down another flow. The current flow will pause until the subflow exits or expires.
A [event:run_started] event will be created to record that a new run was started.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "enter_flow",
"flow": {"uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "name": "Collect Language"},
"terminal": false
}
@action enter_flow
func NewEnterFlow ¶ added in v0.48.0
func NewEnterFlow(uuid flows.ActionUUID, flow *assets.FlowReference, terminal bool) *EnterFlow
NewEnterFlow creates a new start flow action
func (*EnterFlow) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*EnterFlow) Execute ¶ added in v0.249.0
func (a *EnterFlow) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs our action
func (*EnterFlow) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*EnterFlow) Type ¶ added in v0.249.0
func (a *EnterFlow) Type() string
Type returns the type of this action
func (*EnterFlow) UUID ¶ added in v0.249.0
func (a *EnterFlow) UUID() flows.ActionUUID
UUID returns the UUID of the action
type LocalOperation ¶ added in v0.235.0
type LocalOperation string
const ( LocalOperationSet LocalOperation = "set" LocalOperationIncrement LocalOperation = "increment" LocalOperationClear LocalOperation = "clear" )
type OpenTicket ¶ added in v0.249.0
type OpenTicket struct {
Topic *assets.TopicReference `json:"topic"`
Note string `json:"note" engine:"evaluated"`
Assignee *assets.UserReference `json:"assignee,omitempty"`
// contains filtered or unexported fields
}
OpenTicket is used to open a ticket for the contact if they don't already have an open ticket.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "open_ticket",
"topic": {
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4",
"name": "Weather"
},
"note": "@input",
"assignee": {"uuid": "0c78ef47-7d56-44d8-8f57-96e0f30e8f44", "name": "Bob McTickets"}
}
@action open_ticket
func NewOpenTicket ¶ added in v0.86.0
func NewOpenTicket(uuid flows.ActionUUID, topic *assets.TopicReference, note string, assignee *assets.UserReference) *OpenTicket
NewOpenTicket creates a new open ticket action
func (*OpenTicket) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*OpenTicket) Execute ¶ added in v0.249.0
func (a *OpenTicket) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*OpenTicket) Inspect ¶ added in v0.249.0
func (a *OpenTicket) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*OpenTicket) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*OpenTicket) Type ¶ added in v0.249.0
func (a *OpenTicket) Type() string
Type returns the type of this action
func (*OpenTicket) UUID ¶ added in v0.249.0
func (a *OpenTicket) UUID() flows.ActionUUID
UUID returns the UUID of the action
type PlayAudio ¶ added in v0.249.0
type PlayAudio struct {
AudioURL string `json:"audio_url" validate:"required" engine:"localized,evaluated"`
// contains filtered or unexported fields
}
PlayAudio can be used to play an audio recording in a voice flow. It will generate an [event:ivr_created] event if there is a valid audio URL. This will contain a message which the caller should handle as an IVR play command using the audio attachment.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "play_audio",
"audio_url": "http://uploads.temba.io/2353262.m4a"
}
@action play_audio
func NewPlayAudio ¶ added in v0.48.0
func NewPlayAudio(uuid flows.ActionUUID, audioURL string) *PlayAudio
NewPlayAudio creates a new play message action
func (*PlayAudio) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*PlayAudio) Execute ¶ added in v0.249.0
func (a *PlayAudio) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*PlayAudio) Inspect ¶ added in v0.249.0
func (a *PlayAudio) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*PlayAudio) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*PlayAudio) Type ¶ added in v0.249.0
func (a *PlayAudio) Type() string
Type returns the type of this action
func (*PlayAudio) UUID ¶ added in v0.249.0
func (a *PlayAudio) UUID() flows.ActionUUID
UUID returns the UUID of the action
type RemoveContactGroups ¶ added in v0.249.0
type RemoveContactGroups struct {
Groups []*assets.GroupReference `json:"groups,omitempty" validate:"dive"`
AllGroups bool `json:"all_groups,omitempty"`
// contains filtered or unexported fields
}
RemoveContactGroups can be used to remove a contact from one or more groups. A [event:contact_groups_changed] event will be created for the groups which the contact is removed from. Groups can either be explicitly provided or `all_groups` can be set to true to remove the contact from all non-query based groups.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "remove_contact_groups",
"groups": [{
"uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
"name": "Registered Users"
}]
}
@action remove_contact_groups
func NewRemoveContactGroups ¶ added in v0.48.0
func NewRemoveContactGroups(uuid flows.ActionUUID, groups []*assets.GroupReference, allGroups bool) *RemoveContactGroups
NewRemoveContactGroups creates a new remove from groups action
func (*RemoveContactGroups) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*RemoveContactGroups) Execute ¶ added in v0.249.0
func (a *RemoveContactGroups) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs the action
func (*RemoveContactGroups) Inspect ¶ added in v0.249.0
func (a *RemoveContactGroups) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*RemoveContactGroups) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*RemoveContactGroups) Type ¶ added in v0.249.0
func (a *RemoveContactGroups) Type() string
Type returns the type of this action
func (*RemoveContactGroups) UUID ¶ added in v0.249.0
func (a *RemoveContactGroups) UUID() flows.ActionUUID
UUID returns the UUID of the action
func (*RemoveContactGroups) Validate ¶ added in v0.249.0
func (a *RemoveContactGroups) Validate() error
Validate validates our action is valid
type RequestOptIn ¶ added in v0.249.0
type RequestOptIn struct {
OptIn *assets.OptInReference `json:"optin" validate:"required"`
// contains filtered or unexported fields
}
RequestOptIn can be used to send an optin to the contact if the channel supports that.
An [event:optin_requested] event will be created if the optin was requested.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "request_optin",
"optin": {
"uuid": "248be71d-78e9-4d71-a6c4-9981d369e5cb",
"name": "Joke Of The Day"
}
}
@action request_optin
func NewRequestOptIn ¶ added in v0.195.3
func NewRequestOptIn(uuid flows.ActionUUID, optIn *assets.OptInReference) *RequestOptIn
NewRequestOptIn creates a new request optin action
func (*RequestOptIn) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*RequestOptIn) Execute ¶ added in v0.249.0
func (a *RequestOptIn) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute creates the optin events
func (*RequestOptIn) Inspect ¶ added in v0.249.0
func (a *RequestOptIn) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*RequestOptIn) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*RequestOptIn) Type ¶ added in v0.249.0
func (a *RequestOptIn) Type() string
Type returns the type of this action
func (*RequestOptIn) UUID ¶ added in v0.249.0
func (a *RequestOptIn) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SayMsg ¶ added in v0.249.0
type SayMsg struct {
Text string `json:"text" validate:"required,max=10000" engine:"localized,evaluated"`
AudioURL string `json:"audio_url,omitempty"`
// contains filtered or unexported fields
}
SayMsg can be used to communicate with the contact in a voice flow by either reading a message with TTS or playing a pre-recorded audio file. It will generate an [event:ivr_created] event if there is a valid audio URL or backdown text. This will contain a message which the caller should handle as an IVR play command if it has an audio attachment, or otherwise an IVR say command using the message text.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "say_msg",
"audio_url": "http://uploads.temba.io/2353262.m4a",
"text": "Hi @contact.name, are you ready to complete today's survey?"
}
@action say_msg
func NewSayMsg ¶ added in v0.48.0
func NewSayMsg(uuid flows.ActionUUID, text string, audioURL string) *SayMsg
NewSayMsg creates a new say message action
func (*SayMsg) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SayMsg) Execute ¶ added in v0.249.0
func (a *SayMsg) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SayMsg) Inspect ¶ added in v0.249.0
func (a *SayMsg) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SayMsg) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SayMsg) Type ¶ added in v0.249.0
func (a *SayMsg) Type() string
Type returns the type of this action
func (*SayMsg) UUID ¶ added in v0.249.0
func (a *SayMsg) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SendBroadcast ¶ added in v0.249.0
type SendBroadcast struct {
// contains filtered or unexported fields
}
SendBroadcast can be used to send a message to one or more contacts. It accepts a list of URNs, a list of groups and a list of contacts.
The URNs and text fields may be templates. A [event:broadcast_created] event will be created for each unique urn, contact and group with the evaluated text.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "send_broadcast",
"urns": ["tel:+12065551212"],
"text": "Hi @contact.name, are you ready to complete today's survey?"
}
@action send_broadcast
func NewSendBroadcast ¶ added in v0.48.0
func NewSendBroadcast(uuid flows.ActionUUID, text string, attachments []string, quickReplies []string, groups []*assets.GroupReference, contacts []*flows.ContactReference, contactQuery string, urns []urns.URN, legacyVars []string) *SendBroadcast
NewSendBroadcast creates a new send broadcast action
func (*SendBroadcast) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SendBroadcast) Execute ¶ added in v0.249.0
func (a *SendBroadcast) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SendBroadcast) Inspect ¶ added in v0.249.0
func (a *SendBroadcast) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SendBroadcast) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SendBroadcast) Type ¶ added in v0.249.0
func (a *SendBroadcast) Type() string
Type returns the type of this action
func (*SendBroadcast) UUID ¶ added in v0.249.0
func (a *SendBroadcast) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SendEmail ¶ added in v0.249.0
type SendEmail struct {
Addresses []string `json:"addresses" validate:"required,min=1,dive,max=1000" engine:"evaluated"`
Subject string `json:"subject" validate:"required,max=1000" engine:"localized,evaluated"`
Body string `json:"body" validate:"required,max=10000" engine:"localized,evaluated"`
// contains filtered or unexported fields
}
SendEmail can be used to send an email to one or more recipients. The subject, body and addresses can all contain expressions.
An [event:email_sent] event will be created if the email could be sent.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "send_email",
"addresses": ["@urns.mailto"],
"subject": "Here is your activation token",
"body": "Your activation token is @contact.fields.activation_token"
}
@action send_email
func NewSendEmail ¶ added in v0.48.0
func NewSendEmail(uuid flows.ActionUUID, addresses []string, subject string, body string) *SendEmail
NewSendEmail creates a new send email action
func (*SendEmail) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SendEmail) Execute ¶ added in v0.249.0
func (a *SendEmail) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute creates the email events
func (*SendEmail) Inspect ¶ added in v0.249.0
func (a *SendEmail) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SendEmail) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SendEmail) Type ¶ added in v0.249.0
func (a *SendEmail) Type() string
Type returns the type of this action
func (*SendEmail) UUID ¶ added in v0.249.0
func (a *SendEmail) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SendMsg ¶ added in v0.249.0
type SendMsg struct {
AllURNs bool `json:"all_urns,omitempty"`
Template *assets.TemplateReference `json:"template,omitempty"`
TemplateVariables []string `json:"template_variables,omitempty" engine:"localized,evaluated"`
// contains filtered or unexported fields
}
SendMsg can be used to reply to the current contact in a flow. The text field may contain templates. The action will attempt to find pairs of URNs and channels which can be used for sending. If it can't find such a pair, it will create a message without a channel or URN.
A [event:msg_created] event will be created with the evaluated text.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "send_msg",
"text": "Hi @contact.name, are you ready to complete today's survey?",
"attachments": [],
"all_urns": false,
"template": {
"uuid": "3ce100b7-a734-4b4e-891b-350b1279ade2",
"name": "revive_issue"
},
"template_variables": ["@contact.name"]
}
@action send_msg
func NewSendMsg ¶ added in v0.48.0
func NewSendMsg(uuid flows.ActionUUID, text string, attachments []string, quickReplies []string, allURNs bool) *SendMsg
NewSendMsg creates a new send msg action
func (*SendMsg) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SendMsg) Execute ¶ added in v0.249.0
func (a *SendMsg) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SendMsg) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SendMsg) Type ¶ added in v0.249.0
func (a *SendMsg) Type() string
Type returns the type of this action
func (*SendMsg) UUID ¶ added in v0.249.0
func (a *SendMsg) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactChannel ¶ added in v0.249.0
type SetContactChannel struct {
Channel *assets.ChannelReference `json:"channel" validate:"omitempty"`
// contains filtered or unexported fields
}
SetContactChannel can be used to change or clear the preferred channel of the current contact.
Because channel affinity is a property of a contact's URNs, a [event:contact_urns_changed] event will be created if any changes are made to the contact's URNs.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_contact_channel",
"channel": {"uuid": "4bb288a0-7fca-4da1-abe8-59a593aff648", "name": "Facebook Channel"}
}
@action set_contact_channel
func NewSetContactChannel ¶ added in v0.48.0
func NewSetContactChannel(uuid flows.ActionUUID, channel *assets.ChannelReference) *SetContactChannel
NewSetContactChannel creates a new set channel action
func (*SetContactChannel) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactChannel) Execute ¶ added in v0.249.0
func (a *SetContactChannel) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs our action
func (*SetContactChannel) Inspect ¶ added in v0.249.0
func (a *SetContactChannel) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetContactChannel) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactChannel) Type ¶ added in v0.249.0
func (a *SetContactChannel) Type() string
Type returns the type of this action
func (*SetContactChannel) UUID ¶ added in v0.249.0
func (a *SetContactChannel) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactField ¶ added in v0.249.0
type SetContactField struct {
Field *assets.FieldReference `json:"field" validate:"required"`
Value string `json:"value" engine:"evaluated"`
// contains filtered or unexported fields
}
SetContactField can be used to update a field value on the contact. The value is a localizable template and white space is trimmed from the final value. An empty string clears the value. A [event:contact_field_changed] event will be created with the corresponding value.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_contact_field",
"field": {"key": "gender", "name": "Gender"},
"value": "Female"
}
@action set_contact_field
func NewSetContactField ¶ added in v0.48.0
func NewSetContactField(uuid flows.ActionUUID, field *assets.FieldReference, value string) *SetContactField
NewSetContactField creates a new set channel action
func (*SetContactField) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactField) Execute ¶ added in v0.249.0
func (a *SetContactField) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetContactField) Inspect ¶ added in v0.249.0
func (a *SetContactField) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetContactField) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactField) Type ¶ added in v0.249.0
func (a *SetContactField) Type() string
Type returns the type of this action
func (*SetContactField) UUID ¶ added in v0.249.0
func (a *SetContactField) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactLanguage ¶ added in v0.249.0
type SetContactLanguage struct {
Language string `json:"language" engine:"evaluated"`
// contains filtered or unexported fields
}
SetContactLanguage can be used to update the name of the contact. The language is a localizable template and white space is trimmed from the final value. An empty string clears the language. A [event:contact_language_changed] event will be created with the corresponding value.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_contact_language",
"language": "eng"
}
@action set_contact_language
func NewSetContactLanguage ¶ added in v0.48.0
func NewSetContactLanguage(uuid flows.ActionUUID, language string) *SetContactLanguage
NewSetContactLanguage creates a new set language action
func (*SetContactLanguage) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactLanguage) Execute ¶ added in v0.249.0
func (a *SetContactLanguage) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetContactLanguage) Inspect ¶ added in v0.249.0
func (a *SetContactLanguage) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetContactLanguage) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactLanguage) Type ¶ added in v0.249.0
func (a *SetContactLanguage) Type() string
Type returns the type of this action
func (*SetContactLanguage) UUID ¶ added in v0.249.0
func (a *SetContactLanguage) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactName ¶ added in v0.249.0
type SetContactName struct {
Name string `json:"name" validate:"max=1000" engine:"evaluated"`
// contains filtered or unexported fields
}
SetContactName can be used to update the name of the contact. The name is a localizable template and white space is trimmed from the final value. An empty string clears the name. A [event:contact_name_changed] event will be created with the corresponding value.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_contact_name",
"name": "Bob Smith"
}
@action set_contact_name
func NewSetContactName ¶ added in v0.48.0
func NewSetContactName(uuid flows.ActionUUID, name string) *SetContactName
NewSetContactName creates a new set name action
func (*SetContactName) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactName) Execute ¶ added in v0.249.0
func (a *SetContactName) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetContactName) Inspect ¶ added in v0.249.0
func (a *SetContactName) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetContactName) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactName) Type ¶ added in v0.249.0
func (a *SetContactName) Type() string
Type returns the type of this action
func (*SetContactName) UUID ¶ added in v0.249.0
func (a *SetContactName) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactStatus ¶ added in v0.249.0
type SetContactStatus struct {
Status flows.ContactStatus `json:"status" validate:"contact_status"`
// contains filtered or unexported fields
}
SetContactStatus can be used to update the status of the contact, e.g. to block or unblock the contact. A [event:contact_status_changed] event will be created with the corresponding value.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_contact_status",
"status": "blocked"
}
@action set_contact_status
func NewSetContactStatus ¶ added in v0.96.0
func NewSetContactStatus(uuid flows.ActionUUID, status flows.ContactStatus) *SetContactStatus
NewSetContactStatus creates a new set status action
func (*SetContactStatus) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactStatus) Execute ¶ added in v0.249.0
func (a *SetContactStatus) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetContactStatus) Inspect ¶ added in v0.249.0
func (a *SetContactStatus) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetContactStatus) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactStatus) Type ¶ added in v0.249.0
func (a *SetContactStatus) Type() string
Type returns the type of this action
func (*SetContactStatus) UUID ¶ added in v0.249.0
func (a *SetContactStatus) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactTimezone ¶ added in v0.249.0
type SetContactTimezone struct {
Timezone string `json:"timezone" engine:"evaluated"`
// contains filtered or unexported fields
}
SetContactTimezone can be used to update the timezone of the contact. The timezone is a localizable template and white space is trimmed from the final value. An empty string clears the timezone. A [event:contact_timezone_changed] event will be created with the corresponding value.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_contact_timezone",
"timezone": "Africa/Kigali"
}
@action set_contact_timezone
func NewSetContactTimezone ¶ added in v0.48.0
func NewSetContactTimezone(uuid flows.ActionUUID, timezone string) *SetContactTimezone
NewSetContactTimezone creates a new set timezone action
func (*SetContactTimezone) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactTimezone) Execute ¶ added in v0.249.0
func (a *SetContactTimezone) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetContactTimezone) Inspect ¶ added in v0.249.0
func (a *SetContactTimezone) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetContactTimezone) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactTimezone) Type ¶ added in v0.249.0
func (a *SetContactTimezone) Type() string
Type returns the type of this action
func (*SetContactTimezone) UUID ¶ added in v0.249.0
func (a *SetContactTimezone) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetRunLocal ¶ added in v0.249.0
type SetRunLocal struct {
Local string `json:"local" validate:"required,local_ref"`
Value string `json:"value,omitempty" engine:"evaluated" validate:"max=1000"`
Operation LocalOperation `json:"operation" validate:"required,eq=set|eq=increment|eq=clear"`
// contains filtered or unexported fields
}
SetRunLocal can be used to save a local variable. The local will be available in the context for the run as @locals.[local]. The value field can be a template and will be evaluated.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_run_local",
"local": "my_var",
"value": "1",
"operation": "increment"
}
@action set_run_local
func NewSetRunLocal ¶ added in v0.235.0
func NewSetRunLocal(uuid flows.ActionUUID, local, value string) *SetRunLocal
NewSetRunLocal creates a new set run local action
func (*SetRunLocal) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetRunLocal) Execute ¶ added in v0.249.0
func (a *SetRunLocal) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetRunLocal) Inspect ¶ added in v0.249.0
func (a *SetRunLocal) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetRunLocal) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetRunLocal) Type ¶ added in v0.249.0
func (a *SetRunLocal) Type() string
Type returns the type of this action
func (*SetRunLocal) UUID ¶ added in v0.249.0
func (a *SetRunLocal) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetRunResult ¶ added in v0.249.0
type SetRunResult struct {
Name string `json:"name" validate:"required,result_name"`
Value string `json:"value" engine:"evaluated"`
Category string `json:"category,omitempty" engine:"localized" validate:"omitempty,result_category"`
// contains filtered or unexported fields
}
SetRunResult can be used to save a result for a flow. The result will be available in the context for the run as @results.[name]. The optional category can be used as a way of categorizing results, this can be useful for reporting or analytics.
Both the value and category fields may be templates. A [event:run_result_changed] event will be created with the final values.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "set_run_result",
"name": "Gender",
"value": "m",
"category": "Male"
}
@action set_run_result
func NewSetRunResult ¶ added in v0.48.0
func NewSetRunResult(uuid flows.ActionUUID, name string, value string, category string) *SetRunResult
NewSetRunResult creates a new set run result action
func (*SetRunResult) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetRunResult) Execute ¶ added in v0.249.0
func (a *SetRunResult) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs this action
func (*SetRunResult) Inspect ¶ added in v0.249.0
func (a *SetRunResult) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*SetRunResult) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetRunResult) Type ¶ added in v0.249.0
func (a *SetRunResult) Type() string
Type returns the type of this action
func (*SetRunResult) UUID ¶ added in v0.249.0
func (a *SetRunResult) UUID() flows.ActionUUID
UUID returns the UUID of the action
type StartSession ¶ added in v0.249.0
type StartSession struct {
Flow *assets.FlowReference `json:"flow" validate:"required"`
Exclusions events.Exclusions `json:"exclusions"`
CreateContact bool `json:"create_contact,omitempty"`
// contains filtered or unexported fields
}
StartSession can be used to trigger sessions for other contacts and groups. A [event:session_triggered] event will be created and it's the responsibility of the caller to act on that by initiating a new session with the flow engine.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "start_session",
"flow": {"uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "name": "Registration"},
"groups": [
{"uuid": "1e1ce1e1-9288-4504-869e-022d1003c72a", "name": "Customers"}
],
"exclusions": {"in_a_flow": true}
}
@action start_session
func NewStartSession ¶ added in v0.48.0
func NewStartSession(uuid flows.ActionUUID, flow *assets.FlowReference, groups []*assets.GroupReference, contacts []*flows.ContactReference, contactQuery string, urns []urns.URN, legacyVars []string, createContact bool) *StartSession
NewStartSession creates a new start session action
func (*StartSession) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*StartSession) Execute ¶ added in v0.249.0
func (a *StartSession) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute runs our action
func (*StartSession) Inspect ¶ added in v0.249.0
func (a *StartSession) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*StartSession) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*StartSession) Type ¶ added in v0.249.0
func (a *StartSession) Type() string
Type returns the type of this action
func (*StartSession) UUID ¶ added in v0.249.0
func (a *StartSession) UUID() flows.ActionUUID
UUID returns the UUID of the action
type TransferAirtime ¶ added in v0.249.0
type TransferAirtime struct {
Amounts map[string]decimal.Decimal `json:"amounts" validate:"required"`
// contains filtered or unexported fields
}
TransferAirtime attempts to make an airtime transfer to the contact.
An [event:airtime_transferred] event will be created if the airtime could be sent.
{
"uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
"type": "transfer_airtime",
"amounts": {"RWF": 500, "USD": 0.5}
}
@action transfer_airtime
func NewTransferAirtime ¶ added in v0.48.0
func NewTransferAirtime(uuid flows.ActionUUID, amounts map[string]decimal.Decimal) *TransferAirtime
NewTransferAirtime creates a new airtime transfer action
func (*TransferAirtime) AllowedFlowTypes ¶ added in v0.249.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*TransferAirtime) Execute ¶ added in v0.249.0
func (a *TransferAirtime) Execute(ctx context.Context, run flows.Run, step flows.Step, log flows.EventLogger) error
Execute executes the transfer action
func (*TransferAirtime) Inspect ¶ added in v0.249.0
func (a *TransferAirtime) Inspect(dependency func(assets.Reference), local func(string), result func(*flows.ResultInfo))
func (*TransferAirtime) LocalizationUUID ¶ added in v0.249.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*TransferAirtime) Type ¶ added in v0.249.0
func (a *TransferAirtime) Type() string
Type returns the type of this action
func (*TransferAirtime) UUID ¶ added in v0.249.0
func (a *TransferAirtime) UUID() flows.ActionUUID
UUID returns the UUID of the action
Source Files
¶
- add_contact_groups.go
- add_contact_urn.go
- add_input_labels.go
- base.go
- call_classifier.go
- call_llm.go
- call_resthook.go
- call_webhook.go
- enter_flow.go
- open_ticket.go
- play_audio.go
- remove_contact_groups.go
- request_optin.go
- say_msg.go
- send_broadcast.go
- send_email.go
- send_msg.go
- set_contact_channel.go
- set_contact_field.go
- set_contact_language.go
- set_contact_name.go
- set_contact_status.go
- set_contact_timezone.go
- set_run_local.go
- set_run_result.go
- start_session.go
- transfer_airtime.go