# Oracle with Asset tokenisation

Oracles can be used with asset tokenisation in workflows as triggers or action blocks (to fetch external data).

Learn more about [workflow](https://docs.spydra.app/how-to/private-network/workflow "mention")

#### <mark style="color:blue;">Trigger:</mark>

An oracle scheduler can be used as a [trigger](https://docs.spydra.app/how-to/private-network/workflow/triggers) to initiate a workflow. Every time the selected oracle scheduler fetches data from an external source, the workflow is triggered. To use oracle scheduler as a trigger.

1. Select workflow trigger type '**On Oracle Schedule**'
2. Then, select an oracle scheduler from list active oracle schedulers defined in the selected application's channel.

{% hint style="info" %}
To reference the oracle scheduler's response later in the workflow. Use variables - <mark style="color:orange;">`${input.`</mark>variablekey<mark style="color:orange;">`}`</mark>
{% endhint %}

<figure><img src="https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FhB8sd4C5n0irAvkBVXxi%2FScreenshot%202023-09-20%20at%206.18.14%20PM.png?alt=media&#x26;token=d12b4299-941e-42ed-bc0f-ab30ed644ce1" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">Action (get external data):</mark>

An oracle can be called from a workflow as an [action](https://docs.spydra.app/how-to/private-network/workflow/actions) block to fetch external data which can be used at any point in the workflow. To use oracle in workflow.

1. Select '**Add Action**' block.
2. In the select action type **'Get External data (oracle)'**
3. Based on the oracle param type, enter the arguments
   * if the param type is path : one key-value
   * if the param type is query: multiple key-values
   * if the param type is body: an input box for user to enter JSON, XML etc
   * if the param type is none: no arguments needed

{% hint style="info" %}
To reference the oracle action block's response later in the workflow. Use variables - <mark style="color:orange;">`${`</mark>oracleBlockName<mark style="color:orange;">.</mark><mark style="color:orange;">`output.`</mark>variablekey<mark style="color:orange;">`}`</mark>
{% endhint %}

<figure><img src="https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FbTFm3QhKgM1F1spKGKbL%2FScreenshot%202023-09-20%20at%206.10.01%20PM.png?alt=media&#x26;token=e078b15f-5d64-4c84-88ce-0df355d68b8e" alt=""><figcaption><p>GetGSTData is the get external data action block's name in the workflow</p></figcaption></figure>
