Documentation ¶
Index ¶
- Constants
- func ReadAction(data json.RawMessage) (flows.Action, error)
- func RegisteredTypes() map[string](func() flows.Action)
- type AddContactGroupsAction
- func (a *AddContactGroupsAction) AllowedFlowTypes() []flows.FlowType
- func (a *AddContactGroupsAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *AddContactGroupsAction) LocalizationUUID() uuids.UUID
- func (a *AddContactGroupsAction) Type() string
- func (a *AddContactGroupsAction) UUID() flows.ActionUUID
- func (a *AddContactGroupsAction) Validate() error
- type AddContactURNAction
- func (a *AddContactURNAction) AllowedFlowTypes() []flows.FlowType
- func (a *AddContactURNAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *AddContactURNAction) LocalizationUUID() uuids.UUID
- func (a *AddContactURNAction) Type() string
- func (a *AddContactURNAction) UUID() flows.ActionUUID
- func (a *AddContactURNAction) Validate() error
- type AddInputLabelsAction
- func (a *AddInputLabelsAction) AllowedFlowTypes() []flows.FlowType
- func (a *AddInputLabelsAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *AddInputLabelsAction) LocalizationUUID() uuids.UUID
- func (a *AddInputLabelsAction) Type() string
- func (a *AddInputLabelsAction) UUID() flows.ActionUUID
- func (a *AddInputLabelsAction) Validate() error
- type CallClassifierAction
- func (a *CallClassifierAction) AllowedFlowTypes() []flows.FlowType
- func (a *CallClassifierAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *CallClassifierAction) LocalizationUUID() uuids.UUID
- func (a *CallClassifierAction) Results(include func(*flows.ResultInfo))
- func (a *CallClassifierAction) Type() string
- func (a *CallClassifierAction) UUID() flows.ActionUUID
- func (a *CallClassifierAction) Validate() error
- type CallResthookAction
- func (a *CallResthookAction) AllowedFlowTypes() []flows.FlowType
- func (a *CallResthookAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *CallResthookAction) LocalizationUUID() uuids.UUID
- func (a *CallResthookAction) Results(include func(*flows.ResultInfo))
- func (a *CallResthookAction) Type() string
- func (a *CallResthookAction) UUID() flows.ActionUUID
- func (a *CallResthookAction) Validate() error
- type CallWebhookAction
- func (a *CallWebhookAction) AllowedFlowTypes() []flows.FlowType
- func (a *CallWebhookAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *CallWebhookAction) LocalizationUUID() uuids.UUID
- func (a *CallWebhookAction) Results(include func(*flows.ResultInfo))
- func (a *CallWebhookAction) Type() string
- func (a *CallWebhookAction) UUID() flows.ActionUUID
- func (a *CallWebhookAction) Validate() error
- type EnterFlowAction
- func (a *EnterFlowAction) AllowedFlowTypes() []flows.FlowType
- func (a *EnterFlowAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *EnterFlowAction) LocalizationUUID() uuids.UUID
- func (a *EnterFlowAction) Type() string
- func (a *EnterFlowAction) UUID() flows.ActionUUID
- func (a *EnterFlowAction) Validate() error
- type OpenTicketAction
- func (a *OpenTicketAction) AllowedFlowTypes() []flows.FlowType
- func (a *OpenTicketAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *OpenTicketAction) LocalizationUUID() uuids.UUID
- func (a *OpenTicketAction) Type() string
- func (a *OpenTicketAction) UUID() flows.ActionUUID
- func (a *OpenTicketAction) Validate() error
- type PlayAudioAction
- func (a *PlayAudioAction) AllowedFlowTypes() []flows.FlowType
- func (a *PlayAudioAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *PlayAudioAction) LocalizationUUID() uuids.UUID
- func (a *PlayAudioAction) Type() string
- func (a *PlayAudioAction) UUID() flows.ActionUUID
- func (a *PlayAudioAction) Validate() error
- type RemoveContactGroupsAction
- func (a *RemoveContactGroupsAction) AllowedFlowTypes() []flows.FlowType
- func (a *RemoveContactGroupsAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *RemoveContactGroupsAction) LocalizationUUID() uuids.UUID
- func (a *RemoveContactGroupsAction) Type() string
- func (a *RemoveContactGroupsAction) UUID() flows.ActionUUID
- func (a *RemoveContactGroupsAction) Validate() error
- type RequestOptInAction
- func (a *RequestOptInAction) AllowedFlowTypes() []flows.FlowType
- func (a *RequestOptInAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *RequestOptInAction) LocalizationUUID() uuids.UUID
- func (a *RequestOptInAction) Type() string
- func (a *RequestOptInAction) UUID() flows.ActionUUID
- func (a *RequestOptInAction) Validate() error
- type SayMsgAction
- func (a *SayMsgAction) AllowedFlowTypes() []flows.FlowType
- func (a *SayMsgAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SayMsgAction) LocalizationUUID() uuids.UUID
- func (a *SayMsgAction) Type() string
- func (a *SayMsgAction) UUID() flows.ActionUUID
- func (a *SayMsgAction) Validate() error
- type SendBroadcastAction
- func (a *SendBroadcastAction) AllowedFlowTypes() []flows.FlowType
- func (a *SendBroadcastAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SendBroadcastAction) LocalizationUUID() uuids.UUID
- func (a *SendBroadcastAction) Type() string
- func (a *SendBroadcastAction) UUID() flows.ActionUUID
- func (a *SendBroadcastAction) Validate() error
- type SendEmailAction
- func (a *SendEmailAction) AllowedFlowTypes() []flows.FlowType
- func (a *SendEmailAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SendEmailAction) LocalizationUUID() uuids.UUID
- func (a *SendEmailAction) Type() string
- func (a *SendEmailAction) UUID() flows.ActionUUID
- func (a *SendEmailAction) Validate() error
- type SendMsgAction
- func (a *SendMsgAction) AllowedFlowTypes() []flows.FlowType
- func (a *SendMsgAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SendMsgAction) LocalizationUUID() uuids.UUID
- func (a *SendMsgAction) Type() string
- func (a *SendMsgAction) UUID() flows.ActionUUID
- func (a *SendMsgAction) Validate() error
- type SetContactChannelAction
- func (a *SetContactChannelAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactChannelAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetContactChannelAction) LocalizationUUID() uuids.UUID
- func (a *SetContactChannelAction) Type() string
- func (a *SetContactChannelAction) UUID() flows.ActionUUID
- func (a *SetContactChannelAction) Validate() error
- type SetContactFieldAction
- func (a *SetContactFieldAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactFieldAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetContactFieldAction) LocalizationUUID() uuids.UUID
- func (a *SetContactFieldAction) Type() string
- func (a *SetContactFieldAction) UUID() flows.ActionUUID
- func (a *SetContactFieldAction) Validate() error
- type SetContactLanguageAction
- func (a *SetContactLanguageAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactLanguageAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetContactLanguageAction) LocalizationUUID() uuids.UUID
- func (a *SetContactLanguageAction) Type() string
- func (a *SetContactLanguageAction) UUID() flows.ActionUUID
- func (a *SetContactLanguageAction) Validate() error
- type SetContactNameAction
- func (a *SetContactNameAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactNameAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetContactNameAction) LocalizationUUID() uuids.UUID
- func (a *SetContactNameAction) Type() string
- func (a *SetContactNameAction) UUID() flows.ActionUUID
- func (a *SetContactNameAction) Validate() error
- type SetContactStatusAction
- func (a *SetContactStatusAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactStatusAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetContactStatusAction) LocalizationUUID() uuids.UUID
- func (a *SetContactStatusAction) Type() string
- func (a *SetContactStatusAction) UUID() flows.ActionUUID
- func (a *SetContactStatusAction) Validate() error
- type SetContactTimezoneAction
- func (a *SetContactTimezoneAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetContactTimezoneAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetContactTimezoneAction) LocalizationUUID() uuids.UUID
- func (a *SetContactTimezoneAction) Type() string
- func (a *SetContactTimezoneAction) UUID() flows.ActionUUID
- func (a *SetContactTimezoneAction) Validate() error
- type SetRunResultAction
- func (a *SetRunResultAction) AllowedFlowTypes() []flows.FlowType
- func (a *SetRunResultAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *SetRunResultAction) LocalizationUUID() uuids.UUID
- func (a *SetRunResultAction) Results(include func(*flows.ResultInfo))
- func (a *SetRunResultAction) Type() string
- func (a *SetRunResultAction) UUID() flows.ActionUUID
- func (a *SetRunResultAction) Validate() error
- type StartSessionAction
- func (a *StartSessionAction) AllowedFlowTypes() []flows.FlowType
- func (a *StartSessionAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *StartSessionAction) LocalizationUUID() uuids.UUID
- func (a *StartSessionAction) Type() string
- func (a *StartSessionAction) UUID() flows.ActionUUID
- func (a *StartSessionAction) Validate() error
- type TransferAirtimeAction
- func (a *TransferAirtimeAction) AllowedFlowTypes() []flows.FlowType
- func (a *TransferAirtimeAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, ...) error
- func (a *TransferAirtimeAction) LocalizationUUID() uuids.UUID
- func (a *TransferAirtimeAction) Results(include func(*flows.ResultInfo))
- func (a *TransferAirtimeAction) Type() string
- func (a *TransferAirtimeAction) UUID() flows.ActionUUID
- func (a *TransferAirtimeAction) Validate() error
Constants ¶
const ( CategorySuccess = "Success" CategorySkipped = "Skipped" CategoryFailure = "Failure" )
common category names
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 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 TypeOpenTicket string = "open_ticket"
TypeOpenTicket is the type for the open ticket 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 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
const TypeTransferAirtime string = "transfer_airtime"
TypeTransferAirtime is the type for the transfer airtime action
Variables ¶
This section is empty.
Functions ¶
func ReadAction ¶ added in v0.11.0
func ReadAction(data json.RawMessage) (flows.Action, error)
ReadAction reads an action from the given JSON
func RegisteredTypes ¶ added in v0.23.0
RegisteredTypes gets the registered types of action
Types ¶
type AddContactGroupsAction ¶ added in v0.6.0
type AddContactGroupsAction struct { Groups []*assets.GroupReference `json:"groups" validate:"required,dive"` // contains filtered or unexported fields }
AddContactGroupsAction 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) *AddContactGroupsAction
NewAddContactGroups creates a new add to groups action
func (*AddContactGroupsAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*AddContactGroupsAction) Execute ¶ added in v0.6.0
func (a *AddContactGroupsAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute adds our contact to the specified groups
func (*AddContactGroupsAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*AddContactGroupsAction) Type ¶ added in v0.6.0
func (a *AddContactGroupsAction) Type() string
Type returns the type of this action
func (*AddContactGroupsAction) UUID ¶ added in v0.48.0
func (a *AddContactGroupsAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type AddContactURNAction ¶ added in v0.6.0
type AddContactURNAction struct { Scheme string `json:"scheme" validate:"urnscheme"` Path string `json:"path" validate:"required" engine:"evaluated"` // contains filtered or unexported fields }
AddContactURNAction 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) *AddContactURNAction
NewAddContactURN creates a new add URN action
func (*AddContactURNAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*AddContactURNAction) Execute ¶ added in v0.6.0
func (a *AddContactURNAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs the labeling action
func (*AddContactURNAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*AddContactURNAction) Type ¶ added in v0.6.0
func (a *AddContactURNAction) Type() string
Type returns the type of this action
func (*AddContactURNAction) UUID ¶ added in v0.48.0
func (a *AddContactURNAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type AddInputLabelsAction ¶ added in v0.6.0
type AddInputLabelsAction struct { Labels []*assets.LabelReference `json:"labels" validate:"required,dive"` // contains filtered or unexported fields }
AddInputLabelsAction 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) *AddInputLabelsAction
NewAddInputLabels creates a new add labels action
func (*AddInputLabelsAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*AddInputLabelsAction) Execute ¶ added in v0.6.0
func (a *AddInputLabelsAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs the labeling action
func (*AddInputLabelsAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*AddInputLabelsAction) Type ¶ added in v0.6.0
func (a *AddInputLabelsAction) Type() string
Type returns the type of this action
func (*AddInputLabelsAction) UUID ¶ added in v0.48.0
func (a *AddInputLabelsAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallClassifierAction ¶ added in v0.51.0
type CallClassifierAction 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 }
CallClassifierAction 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) *CallClassifierAction
NewCallClassifier creates a new call classifier action
func (*CallClassifierAction) AllowedFlowTypes ¶ added in v0.51.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallClassifierAction) Execute ¶ added in v0.51.0
func (a *CallClassifierAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*CallClassifierAction) LocalizationUUID ¶ added in v0.51.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallClassifierAction) Results ¶ added in v0.51.0
func (a *CallClassifierAction) Results(include func(*flows.ResultInfo))
Results enumerates any results generated by this flow object
func (*CallClassifierAction) Type ¶ added in v0.51.0
func (a *CallClassifierAction) Type() string
Type returns the type of this action
func (*CallClassifierAction) UUID ¶ added in v0.51.0
func (a *CallClassifierAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallResthookAction ¶ added in v0.10.20
type CallResthookAction struct { Resthook string `json:"resthook" validate:"required"` ResultName string `json:"result_name,omitempty" validate:"omitempty,result_name"` // contains filtered or unexported fields }
CallResthookAction 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) *CallResthookAction
NewCallResthook creates a new call resthook action
func (*CallResthookAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallResthookAction) Execute ¶ added in v0.10.20
func (a *CallResthookAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*CallResthookAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallResthookAction) Results ¶ added in v0.42.0
func (a *CallResthookAction) Results(include func(*flows.ResultInfo))
Results enumerates any results generated by this flow object
func (*CallResthookAction) Type ¶ added in v0.10.20
func (a *CallResthookAction) Type() string
Type returns the type of this action
func (*CallResthookAction) UUID ¶ added in v0.48.0
func (a *CallResthookAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type CallWebhookAction ¶ added in v0.6.0
type CallWebhookAction 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 }
CallWebhookAction 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) *CallWebhookAction
NewCallWebhook creates a new call webhook action
func (*CallWebhookAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*CallWebhookAction) Execute ¶ added in v0.6.0
func (a *CallWebhookAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*CallWebhookAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*CallWebhookAction) Results ¶ added in v0.42.0
func (a *CallWebhookAction) Results(include func(*flows.ResultInfo))
Results enumerates any results generated by this flow object
func (*CallWebhookAction) Type ¶ added in v0.6.0
func (a *CallWebhookAction) Type() string
Type returns the type of this action
func (*CallWebhookAction) UUID ¶ added in v0.48.0
func (a *CallWebhookAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
func (*CallWebhookAction) Validate ¶ added in v0.6.0
func (a *CallWebhookAction) Validate() error
Validate validates our action is valid
type EnterFlowAction ¶ added in v0.25.0
type EnterFlowAction struct { Flow *assets.FlowReference `json:"flow" validate:"required"` Terminal bool `json:"terminal,omitempty"` // contains filtered or unexported fields }
EnterFlowAction can be used to start a contact down another flow. The current flow will pause until the subflow exits or expires.
A [event:flow_entered] event will be created to record that the flow 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) *EnterFlowAction
NewEnterFlow creates a new start flow action
func (*EnterFlowAction) AllowedFlowTypes ¶ added in v0.25.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*EnterFlowAction) Execute ¶ added in v0.25.0
func (a *EnterFlowAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs our action
func (*EnterFlowAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*EnterFlowAction) Type ¶ added in v0.48.0
func (a *EnterFlowAction) Type() string
Type returns the type of this action
func (*EnterFlowAction) UUID ¶ added in v0.48.0
func (a *EnterFlowAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type OpenTicketAction ¶ added in v0.86.0
type OpenTicketAction struct { Topic *assets.TopicReference `json:"topic" validate:"omitempty"` Body string `json:"body" engine:"evaluated"` // TODO will become "note" in future migration Assignee *assets.UserReference `json:"assignee" validate:"omitempty"` ResultName string `json:"result_name" validate:"required,result_name"` // contains filtered or unexported fields }
OpenTicketAction 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" }, "body": "@input", "assignee": {"email": "bob@nyaruka.com", "name": "Bob McTickets"}, "result_name": "Help Ticket" }
@action open_ticket
func NewOpenTicket ¶ added in v0.86.0
func NewOpenTicket(uuid flows.ActionUUID, topic *assets.TopicReference, body string, assignee *assets.UserReference, resultName string) *OpenTicketAction
NewOpenTicket creates a new open ticket action
func (*OpenTicketAction) AllowedFlowTypes ¶ added in v0.86.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*OpenTicketAction) Execute ¶ added in v0.86.0
func (a *OpenTicketAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*OpenTicketAction) LocalizationUUID ¶ added in v0.86.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*OpenTicketAction) Type ¶ added in v0.86.0
func (a *OpenTicketAction) Type() string
Type returns the type of this action
func (*OpenTicketAction) UUID ¶ added in v0.86.0
func (a *OpenTicketAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type PlayAudioAction ¶ added in v0.24.0
type PlayAudioAction struct { AudioURL string `json:"audio_url" validate:"required" engine:"localized,evaluated"` // contains filtered or unexported fields }
PlayAudioAction 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) *PlayAudioAction
NewPlayAudio creates a new play message action
func (*PlayAudioAction) AllowedFlowTypes ¶ added in v0.24.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*PlayAudioAction) Execute ¶ added in v0.24.0
func (a *PlayAudioAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*PlayAudioAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*PlayAudioAction) Type ¶ added in v0.48.0
func (a *PlayAudioAction) Type() string
Type returns the type of this action
func (*PlayAudioAction) UUID ¶ added in v0.48.0
func (a *PlayAudioAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type RemoveContactGroupsAction ¶ added in v0.6.0
type RemoveContactGroupsAction struct { Groups []*assets.GroupReference `json:"groups,omitempty" validate:"dive"` AllGroups bool `json:"all_groups,omitempty"` // contains filtered or unexported fields }
RemoveContactGroupsAction 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) *RemoveContactGroupsAction
NewRemoveContactGroups creates a new remove from groups action
func (*RemoveContactGroupsAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*RemoveContactGroupsAction) Execute ¶ added in v0.6.0
func (a *RemoveContactGroupsAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs the action
func (*RemoveContactGroupsAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*RemoveContactGroupsAction) Type ¶ added in v0.6.0
func (a *RemoveContactGroupsAction) Type() string
Type returns the type of this action
func (*RemoveContactGroupsAction) UUID ¶ added in v0.48.0
func (a *RemoveContactGroupsAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
func (*RemoveContactGroupsAction) Validate ¶ added in v0.6.0
func (a *RemoveContactGroupsAction) Validate() error
Validate validates our action is valid
type RequestOptInAction ¶ added in v0.195.3
type RequestOptInAction struct { OptIn *assets.OptInReference `json:"optin" validate:"required"` // contains filtered or unexported fields }
RequestOptInAction 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) *RequestOptInAction
NewRequestOptIn creates a new request optin action
func (*RequestOptInAction) AllowedFlowTypes ¶ added in v0.195.3
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*RequestOptInAction) Execute ¶ added in v0.195.3
func (a *RequestOptInAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute creates the optin events
func (*RequestOptInAction) LocalizationUUID ¶ added in v0.195.3
LocalizationUUID gets the UUID which identifies this object for localization
func (*RequestOptInAction) Type ¶ added in v0.195.3
func (a *RequestOptInAction) Type() string
Type returns the type of this action
func (*RequestOptInAction) UUID ¶ added in v0.195.3
func (a *RequestOptInAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SayMsgAction ¶ added in v0.24.0
type SayMsgAction struct { Text string `json:"text" validate:"required" engine:"localized,evaluated"` AudioURL string `json:"audio_url,omitempty"` // contains filtered or unexported fields }
SayMsgAction 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) *SayMsgAction
NewSayMsg creates a new say message action
func (*SayMsgAction) AllowedFlowTypes ¶ added in v0.24.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SayMsgAction) Execute ¶ added in v0.24.0
func (a *SayMsgAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SayMsgAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SayMsgAction) Type ¶ added in v0.48.0
func (a *SayMsgAction) Type() string
Type returns the type of this action
func (*SayMsgAction) UUID ¶ added in v0.48.0
func (a *SayMsgAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SendBroadcastAction ¶ added in v0.6.0
type SendBroadcastAction struct {
// contains filtered or unexported fields
}
SendBroadcastAction 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) *SendBroadcastAction
NewSendBroadcast creates a new send broadcast action
func (*SendBroadcastAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SendBroadcastAction) Execute ¶ added in v0.6.0
func (a *SendBroadcastAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SendBroadcastAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SendBroadcastAction) Type ¶ added in v0.6.0
func (a *SendBroadcastAction) Type() string
Type returns the type of this action
func (*SendBroadcastAction) UUID ¶ added in v0.48.0
func (a *SendBroadcastAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SendEmailAction ¶ added in v0.6.0
type SendEmailAction struct { Addresses []string `json:"addresses" validate:"required,min=1" engine:"evaluated"` Subject string `json:"subject" validate:"required" engine:"localized,evaluated"` Body string `json:"body" validate:"required" engine:"localized,evaluated"` // contains filtered or unexported fields }
SendEmailAction 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) *SendEmailAction
NewSendEmail creates a new send email action
func (*SendEmailAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SendEmailAction) Execute ¶ added in v0.6.0
func (a *SendEmailAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute creates the email events
func (*SendEmailAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SendEmailAction) Type ¶ added in v0.6.0
func (a *SendEmailAction) Type() string
Type returns the type of this action
func (*SendEmailAction) UUID ¶ added in v0.48.0
func (a *SendEmailAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SendMsgAction ¶
type SendMsgAction struct { AllURNs bool `json:"all_urns,omitempty"` Template *assets.TemplateReference `json:"template,omitempty"` TemplateVariables []string `json:"template_variables,omitempty" engine:"localized,evaluated"` Topic flows.MsgTopic `json:"topic,omitempty" validate:"omitempty,msg_topic"` // contains filtered or unexported fields }
SendMsgAction 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"], "topic": "event" }
@action send_msg
func NewSendMsg ¶ added in v0.48.0
func NewSendMsg(uuid flows.ActionUUID, text string, attachments []string, quickReplies []string, allURNs bool) *SendMsgAction
NewSendMsg creates a new send msg action
func (*SendMsgAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SendMsgAction) Execute ¶
func (a *SendMsgAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SendMsgAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SendMsgAction) Type ¶
func (a *SendMsgAction) Type() string
Type returns the type of this action
func (*SendMsgAction) UUID ¶ added in v0.48.0
func (a *SendMsgAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactChannelAction ¶ added in v0.6.0
type SetContactChannelAction struct { Channel *assets.ChannelReference `json:"channel" validate:"omitempty"` // contains filtered or unexported fields }
SetContactChannelAction 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) *SetContactChannelAction
NewSetContactChannel creates a new set channel action
func (*SetContactChannelAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactChannelAction) Execute ¶ added in v0.6.0
func (a *SetContactChannelAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs our action
func (*SetContactChannelAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactChannelAction) Type ¶ added in v0.6.0
func (a *SetContactChannelAction) Type() string
Type returns the type of this action
func (*SetContactChannelAction) UUID ¶ added in v0.48.0
func (a *SetContactChannelAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactFieldAction ¶ added in v0.6.0
type SetContactFieldAction struct { Field *assets.FieldReference `json:"field" validate:"required"` Value string `json:"value" engine:"evaluated"` // contains filtered or unexported fields }
SetContactFieldAction 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) *SetContactFieldAction
NewSetContactField creates a new set channel action
func (*SetContactFieldAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactFieldAction) Execute ¶ added in v0.6.0
func (a *SetContactFieldAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SetContactFieldAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactFieldAction) Type ¶ added in v0.6.0
func (a *SetContactFieldAction) Type() string
Type returns the type of this action
func (*SetContactFieldAction) UUID ¶ added in v0.48.0
func (a *SetContactFieldAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactLanguageAction ¶ added in v0.10.0
type SetContactLanguageAction struct { Language string `json:"language" engine:"evaluated"` // contains filtered or unexported fields }
SetContactLanguageAction 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) *SetContactLanguageAction
NewSetContactLanguage creates a new set language action
func (*SetContactLanguageAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactLanguageAction) Execute ¶ added in v0.10.0
func (a *SetContactLanguageAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SetContactLanguageAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactLanguageAction) Type ¶ added in v0.10.0
func (a *SetContactLanguageAction) Type() string
Type returns the type of this action
func (*SetContactLanguageAction) UUID ¶ added in v0.48.0
func (a *SetContactLanguageAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactNameAction ¶ added in v0.10.0
type SetContactNameAction struct { Name string `json:"name" engine:"evaluated"` // contains filtered or unexported fields }
SetContactNameAction 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) *SetContactNameAction
NewSetContactName creates a new set name action
func (*SetContactNameAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactNameAction) Execute ¶ added in v0.10.0
func (a *SetContactNameAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SetContactNameAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactNameAction) Type ¶ added in v0.10.0
func (a *SetContactNameAction) Type() string
Type returns the type of this action
func (*SetContactNameAction) UUID ¶ added in v0.48.0
func (a *SetContactNameAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactStatusAction ¶ added in v0.96.0
type SetContactStatusAction struct { Status flows.ContactStatus `json:"status" validate:"contact_status"` // contains filtered or unexported fields }
SetContactStatusAction 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) *SetContactStatusAction
NewSetContactStatus creates a new set status action
func (*SetContactStatusAction) AllowedFlowTypes ¶ added in v0.96.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactStatusAction) Execute ¶ added in v0.96.0
func (a *SetContactStatusAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SetContactStatusAction) LocalizationUUID ¶ added in v0.96.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactStatusAction) Type ¶ added in v0.96.0
func (a *SetContactStatusAction) Type() string
Type returns the type of this action
func (*SetContactStatusAction) UUID ¶ added in v0.96.0
func (a *SetContactStatusAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetContactTimezoneAction ¶ added in v0.10.0
type SetContactTimezoneAction struct { Timezone string `json:"timezone" engine:"evaluated"` // contains filtered or unexported fields }
SetContactTimezoneAction 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) *SetContactTimezoneAction
NewSetContactTimezone creates a new set timezone action
func (*SetContactTimezoneAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetContactTimezoneAction) Execute ¶ added in v0.10.0
func (a *SetContactTimezoneAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SetContactTimezoneAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetContactTimezoneAction) Type ¶ added in v0.10.0
func (a *SetContactTimezoneAction) Type() string
Type returns the type of this action
func (*SetContactTimezoneAction) UUID ¶ added in v0.48.0
func (a *SetContactTimezoneAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type SetRunResultAction ¶ added in v0.6.0
type SetRunResultAction 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 }
SetRunResultAction 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) *SetRunResultAction
NewSetRunResult creates a new set run result action
func (*SetRunResultAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*SetRunResultAction) Execute ¶ added in v0.6.0
func (a *SetRunResultAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs this action
func (*SetRunResultAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*SetRunResultAction) Results ¶ added in v0.42.0
func (a *SetRunResultAction) Results(include func(*flows.ResultInfo))
Results enumerates any results generated by this flow object
func (*SetRunResultAction) Type ¶ added in v0.6.0
func (a *SetRunResultAction) Type() string
Type returns the type of this action
func (*SetRunResultAction) UUID ¶ added in v0.48.0
func (a *SetRunResultAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type StartSessionAction ¶ added in v0.4.0
type StartSessionAction struct { Flow *assets.FlowReference `json:"flow" validate:"required"` Exclusions events.Exclusions `json:"exclusions"` CreateContact bool `json:"create_contact,omitempty"` // contains filtered or unexported fields }
StartSessionAction 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) *StartSessionAction
NewStartSession creates a new start session action
func (*StartSessionAction) AllowedFlowTypes ¶ added in v0.14.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*StartSessionAction) Execute ¶ added in v0.4.0
func (a *StartSessionAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute runs our action
func (*StartSessionAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*StartSessionAction) Type ¶ added in v0.4.0
func (a *StartSessionAction) Type() string
Type returns the type of this action
func (*StartSessionAction) UUID ¶ added in v0.48.0
func (a *StartSessionAction) UUID() flows.ActionUUID
UUID returns the UUID of the action
type TransferAirtimeAction ¶ added in v0.48.0
type TransferAirtimeAction struct { Amounts map[string]decimal.Decimal `json:"amounts" validate:"required"` ResultName string `json:"result_name" validate:"required,result_name"` // contains filtered or unexported fields }
TransferAirtimeAction 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}, "result_name": "Reward Transfer" }
@action transfer_airtime
func NewTransferAirtime ¶ added in v0.48.0
func NewTransferAirtime(uuid flows.ActionUUID, amounts map[string]decimal.Decimal, resultName string) *TransferAirtimeAction
NewTransferAirtime creates a new airtime transfer action
func (*TransferAirtimeAction) AllowedFlowTypes ¶ added in v0.48.0
AllowedFlowTypes returns the flow types which this action is allowed to occur in
func (*TransferAirtimeAction) Execute ¶ added in v0.48.0
func (a *TransferAirtimeAction) Execute(run flows.Run, step flows.Step, logModifier flows.ModifierCallback, logEvent flows.EventCallback) error
Execute executes the transfer action
func (*TransferAirtimeAction) LocalizationUUID ¶ added in v0.48.0
LocalizationUUID gets the UUID which identifies this object for localization
func (*TransferAirtimeAction) Results ¶ added in v0.52.0
func (a *TransferAirtimeAction) Results(include func(*flows.ResultInfo))
Results enumerates any results generated by this flow object
func (*TransferAirtimeAction) Type ¶ added in v0.48.0
func (a *TransferAirtimeAction) Type() string
Type returns the type of this action
func (*TransferAirtimeAction) UUID ¶ added in v0.48.0
func (a *TransferAirtimeAction) 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_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_result.go
- start_session.go
- transfer_airtime.go