# Link scenario step

![](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Nnmtk9_gFGWOddsf6%2F-MYuNapOLzvP46opuaEA%2F-MYuPaKuTTmPlFBqM1rh%2Fstep.png?alt=media\&token=126b14bc-8f89-4a84-95b8-54782e5d62c9)

**Link scenario** step throws an object (or a few objects) to scenario.

{% hint style="info" %}
Hint: That step is a great way to use a scenario as a reusable micro-service
{% endhint %}

### Step settings:

#### Choose the object/objects to send

<figure><img src="https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2Fc95gIUTwpwvSivbE8eUB%2Fimage.png?alt=media&#x26;token=4747e9a1-b77a-453f-88e9-11845b6cec74" alt=""><figcaption></figcaption></figure>

* **Current object**. The object from the scenario will be sent
* **Linked object**. Pick the field type of `link` with the ID of the object to send
* **Array of linked objects**. Pick the field type of `arrayLink` with the array of IDs of the objects to send.

#### Pick the link/arrayLink field (for the 2nd and 3rd options above)

<figure><img src="https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FCyR8sb5wYNEmqziuy8P0%2Fimage.png?alt=media&#x26;token=495cb607-7288-482f-b35d-26cf288a08a3" alt=""><figcaption></figcaption></figure>

The `link/arrayLink` may be stored among the object fields or in the context variables.

#### Pick the scenario to call

We'll throw the object (objects in case of arrayLink option) to that scenario.

{% hint style="info" %}

1. Note that the called scenario has to be **published** and **started**
2. You choose the scenario that processes the objects of the sent object's structure
   {% endhint %}

<figure><img src="https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FUaci2qjoUYuYSRxqah8H%2Fimage.png?alt=media&#x26;token=0be0848d-0bea-4a0f-9b37-4e13bef80cf0" alt=""><figcaption></figcaption></figure>

#### Set the sync/async mode

If you want, you may run the called scenario [synchronically](https://readme.directual.com/scenarios/synchronic-scenarios-1). In the sync mode the step will wait until the linked scenario is finished.

<figure><img src="https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FAmyV617zeg8jGkXi1nBz%2Fimage.png?alt=media&#x26;token=16615d00-2446-444a-98ce-282fbc06de7b" alt=""><figcaption></figcaption></figure>

#### Context parameters

If the called scenario has context variables, you'll be able to set the values of those parameters in the **Link scenario** step (using [templating system](https://readme.directual.com/template-system) and [JS-evaluation](https://readme.directual.com/template-system/evaluating-as-js-expression))

<figure><img src="https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FDm6gTOnVeWnaZtWifhVV%2Fimage.png?alt=media&#x26;token=4b331d64-3283-4b72-8373-cd890793dd09" alt=""><figcaption></figcaption></figure>
