Executor Service

The Executor service provides a flexible and efficient mechanism for automating tasks and workflows within a system. It consists of two main properties: Trigger and Target, which allows you to define when and what actions to execute.

Trigger

The Trigger property defines the conditions under which the Executor service initiates an action. It specifies the event type and condition that must be met for the action to be triggered.

You can configure the following three types of triggers to execute the user defined tasks.

1. Event based trigger

In this trigger, you can specify the type of event that initiates it (e.g., Tailor DB data update and StateFlow creation) and outline the specific conditions or criteria for its execution.

Refer Supported Events to learn about the different types of events supported in the Tailor Platform. For setup instructions, see Event based trigger.

2. Incoming webhook trigger

You can configure your API endpoint (webhook URL) for receiving incoming data. See Incoming webhook trigger for setup instructions.

3. Schedule based trigger

This trigger can schedule tasks at specified intervals. For setup instructions, see Schedule based trigger.

Target

The Target property defines the action to be executed when the Trigger condition is met. You can describe the specific task or operation to be performed, such as querying Tailor DB, sending notifications, or triggering workflows. There are two types of targets:

1. TargetTailorGraphql

This involves interaction with the Tailor DB and performs operations such as querying data or making changes (mutations).

2. TargetWebhook

With this type of target, you can send a HTTP request from your executor service. Currently we only support POST method.

Each Trigger can be configured with the above two target types, providing six ways to configure them. Both TargetTailorGraphql and TargetWebhook have a timeout set to 30 seconds. If the process exceeds this limit, it is considered a failure, and a retry will be triggered (up to a maximum of 10 attempts). You can view the number of attempts for each job created for an executor in the Tailor Console. For more details on the number of attempts, refer to the Verify the trigger section of the event based trigger tutorial.

Executor service manifest file

Below is a sample of the Executor service manifest file.

<span><span style="color: var(--shiki-token-keyword)">package</span><span style="color: var(--shiki-color-text)"> executor</span></span>
<span></span>
<span><span style="color: var(--shiki-token-keyword)">import</span><span style="color: var(--shiki-color-text)"> (</span></span>
<span><span style="color: var(--shiki-color-text)">	</span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">github.com/tailor-platform/tailorctl/schema/v2/executor</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	</span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">tailor.build/template/services/pipeline</span><span style="color: var(--shiki-color-text)">:settings</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">)</span></span>
<span></span>
<span><span style="color: var(--shiki-color-text)">executor.#Spec </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Executors: [</span></span>
<span><span style="color: var(--shiki-color-text)">		#eventBasedExecutor</span><span style="color: var(--shiki-token-punctuation)">,</span></span>
<span><span style="color: var(--shiki-color-text)">		#slackNotification</span><span style="color: var(--shiki-token-punctuation)">,</span></span>
<span><span style="color: var(--shiki-color-text)">		#incomingWebhookBasedExecutor</span><span style="color: var(--shiki-token-punctuation)">,</span></span>
<span><span style="color: var(--shiki-color-text)">		#scheduledEventBasedExecutor</span><span style="color: var(--shiki-token-punctuation)">,</span></span>
<span><span style="color: var(--shiki-color-text)">	]</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>
<span><span style="color: var(--shiki-color-text)">#eventBasedExecutor: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	</span><span style="color: var(--shiki-token-comment)">// ...</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span><span style="color: var(--shiki-token-comment)">// ...</span></span>
<span></span>

Examples

Below you can find examples of the three types of Trigger.

Event based trigger

1. Event type: tailordb.type_record.created

The following trigger is based on event type tailordb.type_record.created and target type #TargetTailorGraphql. For every new PurchaseOrder record created in the Tailor DB, a PutAway record is created.

<span><span style="color: var(--shiki-color-text)">#eventBasedExecutor: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Name:        </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">eventbased-executor</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Description: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">Create a data based on the event</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Trigger: executor.#TriggerEvent </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		EventType: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">tailordb.type_record.created</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Condition: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				args.namespaceName == &quot;my-tailordb&quot; &amp;&amp; args.typeName == &quot;PurchaseOrder&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">	Target: executor.#TargetTailorGraphql </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		AppName: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">my-app</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Invoker: settings.adminInvoker</span></span>
<span><span style="color: var(--shiki-color-text)">		Query: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			mutation ($input: createPutAwayWithEventInput!) {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				createPutAwayWithEvent(input: $input)</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			}</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Variables: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			({</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				input: {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					&quot;quantity&quot;: args.newRecord.quantity,</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					&quot;purchaseOrderID&quot;: args.newRecord.id,</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					&quot;putAwayDate&quot;: args.newRecord.purchaseOrderDate</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				}</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			})</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

The sample trigger below is configured with the target type #TargetWebhook. When a new product is created in the Tailor DB, the executor triggers a Slack notification.

<span><span style="color: var(--shiki-color-text)">#slackNotification: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Name:        </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">slacknotification</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Description: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">notify slack when new product is created</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Trigger: executor.#TriggerEvent </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		EventType: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">tailordb.type_record.created</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Condition: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				args.namespaceName == &quot;my-tailordb&quot; &amp;&amp; args.typeName == &quot;Product&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">	Target: executor.#TargetWebhook </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		URL: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">\&quot;https://hooks.slack.com/services/{service-name}/\&quot;</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">		Headers: [</span></span>
<span><span style="color: var(--shiki-color-text)">			{</span></span>
<span><span style="color: var(--shiki-color-text)">				Key:   </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">Content-type</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">				Value: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">application/json</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">			}</span></span>
<span><span style="color: var(--shiki-color-text)">		]</span></span>
<span><span style="color: var(--shiki-color-text)">		Body: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			({</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				&quot;text&quot;: &quot;New Product Registration :tada:&quot;,</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				&quot;blocks&quot;: [</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					{</span></span>
<span><span style="color: var(--shiki-token-string-expression)">						&quot;type&quot;: &quot;section&quot;,</span></span>
<span><span style="color: var(--shiki-token-string-expression)">						&quot;text&quot;: {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">							&quot;type&quot;: &quot;mrkdwn&quot;,</span></span>
<span><span style="color: var(--shiki-token-string-expression)">							&quot;text&quot;: &quot;*New Product Registration* :tada: &quot; + args.newRecord.name</span></span>
<span><span style="color: var(--shiki-token-string-expression)">						}</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					}</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				]</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			})</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

2. Event type: pipeline.resolver.executed

The examples below demonstrate how to configure an executor to trigger based on the pipeline.resolver.executed event.

When the resolver createShipmentFromSalesOrder succeeds, the executor will create a new product in the Tailor DB. Here, the trigger condition evaluates the value of args.succeeded to determine whether to create the product.

<span><span style="color: var(--shiki-color-text)">#triggerCreateShipmentFromSalesOrder: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Name:        </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">eventbased-executor-2</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Description: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">Create new product based on the event</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Trigger: executor.#TriggerEvent </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		EventType: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">pipeline.resolver.executed</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Condition: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				args.namespaceName == &quot;my-pipeline&quot; &amp;&amp; args.resolverName == &quot;createShipmentFromSalesOrder&quot; &amp;&amp; args.succeeded != null</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">	Target: executor.#TargetTailorGraphql </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		AppName: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">my-app</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Query: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			mutation createProduct($title: String!, $description: String!) {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				createProduct(input: {title: $title, description: $description}) {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					id</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				}</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			}</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Variables: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			({</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				&quot;title&quot;: args.succeeded.result.pipelines.createShipment.id,</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				&quot;description&quot;: &quot;Created with a trigger&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			})</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

In the following example, when the resolver createShipmentFromSalesOrder fails, the executor will create a new product in the Tailor DB. Here, the trigger condition evaluates the value of args.failed to determine whether to create the product.

<span><span style="color: var(--shiki-color-text)">#triggerCreateShipmentFromSalesOrderWithError: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Name:        </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">eventbased-executor-3</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Description: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">Create new product based on the event</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Trigger: executor.#TriggerEvent </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		EventType: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">pipeline.resolver.executed</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Condition: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				args.namespaceName == &quot;my-pipeline&quot; &amp;&amp; args.resolverName == &quot;createShipmentFromSalesOrder&quot; &amp;&amp; args.failed != null</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">	Target: executor.#TargetTailorGraphql </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		AppName: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">my-app</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Query: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			mutation createProduct($title: String!) {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				createProduct(input: {title: $title}) {</span></span>
<span><span style="color: var(--shiki-token-string-expression)">					id</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				}</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			}</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Variables: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			({</span></span>
<span><span style="color: var(--shiki-token-string-expression)">				&quot;title&quot;: args.failed.error</span></span>
<span><span style="color: var(--shiki-token-string-expression)">			})</span><span style="color: var(--shiki-color-text)">&quot;&quot;&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

The properties of an executor with an event based trigger are defined as follows:

  • Name: The name of the executor. The name field has the validation rule ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$, and it does not allow capital letters.
  • Description: The description of the executor.
  • Trigger: The type of trigger ex: #TriggerEvent.
    • EventType: The type of event ex: tailordb.type_record.created
    • Condition: The condition for the job to get executed.
  • Target:
    • TargetTailorGraphql
      • AppName: The name of the app.
      • Query: The query to be executed.
      • Variables: The input variables for the query.
      • Invoker: The user role may be required to execute the query.
    • TargetWebhook
      • URL: The URL of the API endpoint.
      • Body:The payload or message to be included in the request.
      • Headers:
        • Key: The key in a request header.
        • Value: The value for a request header key. In the Value, you can leverage secret manager.
      • Secret: Secret is the key to generate tailor-signature-256 signature in your header. You need to use secret manager to store the secret key.
        • VaultName: The name of the vault.
        • SecretKey: The key that stores the secret.

Schedule based trigger

<span><span style="color: var(--shiki-color-text)">scheduledEventBasedExecutor: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Name:         </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">name</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Description:  </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">description</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Trigger: executor.#TriggerSchedule </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		Timezone:  </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">UTC</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		Frequency: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">* * * * *</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">	Target: executor.#TargetWebhook </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		URL: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">\&quot;http://localhost\&quot;</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">		Secret: secretmanager.#SecretValue </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			VaultName: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">vault</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">			SecretKey: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">key</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

The properties of an executor with an schedule based trigger are defined as follows:

  • Name: The name of the executor. The name field has the validation rule ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$, and it does not allow capital letters.
  • Description: The description of the executor.
  • Trigger: The type of trigger ex: #TriggerSchedule.
    • Timezone: This refers to the specific time zone in which the job's scheduled times are interpreted and executed.
    • Frequency: The intervals at which the job is scheduled to run.
  • Target:
    • URL: The URL of the API endpoint.
    • Body:The payload or message to be included in the request.
    • Secret: Secret is the key to generate tailor-signature-256 signature in your header. You need to use secret manager to store the secret key.
      • VaultName: The name of the vault.
      • SecretKey: The key that stores the secret.

Incoming webhook trigger

<span><span style="color: var(--shiki-color-text)">incomingWebhookBasedExecutor: executor.#Executor </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">	Name:    </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">executor-01</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">	Trigger: executor.#TriggerIncomingWebhook</span></span>
<span><span style="color: var(--shiki-color-text)">	Target: executor.#TargetWebhook </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">		URL: common.#Script </span><span style="color: var(--shiki-token-keyword)">&amp;</span><span style="color: var(--shiki-color-text)"> {</span></span>
<span><span style="color: var(--shiki-color-text)">			Expr: </span><span style="color: var(--shiki-color-text)">&quot;</span><span style="color: var(--shiki-token-string-expression)">\&quot;http://localhost\&quot;</span><span style="color: var(--shiki-color-text)">&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">		}</span></span>
<span><span style="color: var(--shiki-color-text)">	}</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

The properties of an executor with an incoming webhook trigger are defined as follows:

  • Name: The name of the executor. The name field has the validation rule ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$, and it does not allow capital letters.
  • Description: The description of the executor.
  • Trigger: The type of trigger ex: #TriggerIncomingWebhook.
  • Target:
    • URL: The URL of the API endpoint.
    • Headers:
      • Key: The key in the request header.
      • Value: The value for the request header key.
    • Body: The input for the API endpoint.