1. Tasks
  2. Create Stub

Tasks

Create Stub

Creates a stub.

This action allows creation of a new stub on Stubber.

Example Uses

  • Use to trigger the creation of a new stub on the platform from a webhook
  • Use on a feedback action on a _create context stub, to create new conversation stubs
  • Use to start a webchat session stub from a creation stub
  • Use in an AI action to open a new support ticket stub

Difference from normal stub creation

Creating a stub with the create_stub task is different from creating a stub manually through the Stubber interface.

When using create_stub:

  • no user is filling in a creation form interactively
  • no creation-form validation is performed through the UI
  • any required starting data should be passed explicitly in params.data
  • the stub is created directly on the specified template program

If your process depends on specific starting values, make sure those values are included in the data object when the task runs.

Consequences

The task attaches an add_event sendaction that will reply to the stubpost with the new stub's stubref. This allows the new stubref to be visible on the stub.

Basic usage

loading...

Parameters

templateuuid
required
string

The UUID of the template from which a stub will be created.


template_branch
required
string

The branch of the template of which a stub will be created.


template_context
required
string

The context of the template of which a stub will be created.


subject
string

Sets the subject of the new stub.

Default: stub created by task


data
object

Data that will be merged into the new stub's stub.data.


copy_contact_lists
boolean

If set to true, the new stub will contain the contact lists of the stub it was created from.

Result

loading...

Properties

stubref
string

The stubref of the newly created stub.


sendActionsList
array

The _add_event action that has been attached by the task.

Examples

Create a stub with data

Creates a stub of the current flow with additional starting data.

loading...