Trigger Block

Description of Trigger Block work

This block is the first block from which the workflow will start, you can customize how the workflow should start using this block. To access the block settings, place the block on the workspace, use the settings button above the block.

Two buttons are available in the block settings: Edit Triggers, Parameters. The first button gives access to setting the trigger type. By default, when adding a block, the Trigger Type setting is set to Manually trigger. The types of triggers available for adding are listed below with decoding.

Trigger type

Manually

Start the workflow manually by pressing the playback button (▶).

Interval

Execute the workflow at intervals, you can define the interval and delay before executing the workflow in the submitted input data.

On a specific date (On a specific date)

Perform the workflow on a specific date and time.

On a specific date (On a specific day)

Complete the workflow on a specific day and time.

On browser startup ( On browser startup )

Perform the workflow when the browser profile that has this extension installed starts.

Cron job (Cron job)

Execute a workflow on a specific day and time. The command is specified in the corn style. Five columns specify the execution time (minute, hour, day, month, day of the week), and can contain a number, a comma-separated list of numbers, a range of numbers separated by hyphens, * or / characters. To read about the corn style, go to https://en.wikipedia.org/wiki/Cron.

Examples of assignments:

Context menu (Context menu)

Run the workflow through the context menu (by right-clicking). When the workflow is executed via the context menu, several variables will be entered into the workflow:

$ctxElSelector: Selector of the item you right-click on

$ctxTextSelection: Selected text

$ctxMediaUrl: URL of the source of the multimedia item (image, video or audio)

$ctxLink: The URL you right-click on the link

But to use this trigger, you must grant autonomy to use the ContextMenu permission. This trigger has two options

  • Workflow name in the context menu

  • A window appears, with which you can set when the workflow appears in the context menu. If none of these options is selected, it will be displayed each time the context menu is displayed.

When visiting a website (When visiting a website)

You can start the workflow when you visit a website that matches the URL or regular expression you entered. Then, when you select the Use regular expression check box, the value you enter is treated as a regular expression.

Keyboard shortcut (Keyboard shortcut)

Perform the workflow using a keyboard shortcut. You can specify a keyboard shortcut by clicking the "Record" button ( ) and pressing the key you want to use.

\

And by default the shortcut doesn't work when the cursor is on an input item, so to prevent this behavior you can check the "Active while typing" checkbox.

Important:

The keyboard shortcut works only when you are on a website. If the website URL starts with chrome:// or chrome-extension://, the shortcut will not work.

\

Use JSCustomEvent for the trigger

The workflow can be triggered with a JavaScript CustomEvent that you can embed in your website. Take a look at an example:

// Using workflow Id

window.dispatchEvent(new CustomEvent('goless:execute-workflow', {

detail: { id: 'workflow-id' }

}));

\

// Using workflow publicId

window.dispatchEvent(new CustomEvent('goless:execute-workflow', {

detail: { publicId: 'public-id' }

}));

In the detail property, you must define an identifier or public identifier for the workflow to run. You can then specify the public workflow identifier in the workflow parameters.

Then, to add variables to this workflow, add dataproperty to the custom event property.

// Using workflow Id

window.dispatchEvent(new CustomEvent('goless:execute-workflow', {

detail: {

id: 'workflow-id',

data: {

variables: {

name: 'John Doe',

search: 'Hello world'

}

}

}

}));

Parameters button

Define the parameters for the workflow. Let's say you have a workflow to automate keyword searches across multiple search engines, and the keyword changes each time you run the workflow. You can add a parameter to the Trigger block where you can enter the keyword each time you run the workflow.

Add a parameter

To add a parameter to your workflow, you need to:

  1. Open a workflow

  2. Click the Edit button on the launcher

  3. Click the Options button.

  4. Click the "Add Parameter" button.

You can rename a parameter, select a parameter type, or enter a default value:

  1. Parameter name. Required to refer to a parameter via the name of a variable in the program. Example: {{ variables@param }}

  2. Parameter Type. Can be one of 5 types.

  3. The name of the parameter displayed at startup.

  4. Default value. It is displayed in the parameter input element when the workflow starts and is available for changing the value.

  5. Description. The user can enter a text description of the parameter.

  6. Placeholder. A placeholder prompt that is displayed in the parameter input element when the workflow is started. It differs from the default value in that the parameter value itself remains empty unless entered by the user.

  7. Required parameter. This checkbox allows you to require the user to fill in a parameter when starting the workflow.

  8. Allows you to customize the input mask.

Parameter types

  • Checkbox

  • Google Drive Sheet

  • Input (number)

  • Input (string)

  • Textarea

When you start the workflow, a pop-up window will appear where you enter the parameter value.

Last updated