> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-gateway/5/add-services-to-workflows/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # Add gateway services to workflows > How to add gateway services to Itential Platform workflows using the runService task in Studio. With Gateway configured and your gateway services registered, you can now use the Itential Platform to orchestrate these services through intuitive workflows that simplify complex network operations. ## Build a workflow with gateway services The following procedures provide a high-level overview for adding a service to a new workflow. For additional guidance, see the following topics: * For more information on variable sources, see [Variable types](/itential-platform/studio/workflows/terminology-concepts#variable-types). * For more information on workflows, see [Create and run workflows](/itential-platform/studio/workflows/create-and-run-workflows). * For more information on tasks, see [Configure and manage tasks](/itential-platform/studio/workflows/tasks/configure-manage-tasks). ## Step 1: Add the runService task to your canvas Open Itential Platform in your browser. Select **Studio** from the **Design** collection in the left-side navigation menu. Click the **plus (+)** icon on the **Studio** homepage. Select **Workflow** in the type dropdown in the **Create** dialog. Enter a name for your new workflow. Click **Create**. The workflow opens in the **Canvas**. In the **Task Palette**, expand the **GatewayManager** section and find the **runService** task. Drag the **runService** task onto the canvas between the **Start** and **End** nodes. Create connections by drawing transitions from **Start** to the **runService** task, and from the **runService** task to **End**. ## Step 2: Configure the runService task Double-click the **runService** task to open the task panel. From the runService task panel, you can specify the gateway cluster and gateway service on that cluster that you want to include in your workflow. When you select a service with decorators attached, the task extracts the expected input variables from the decorator and lists them as input parameters. For more information on decorators, see Using Decorators. ### Set input parameters You can supply input parameters through a key-value form or as a JSON code block. **Key-value form (default):** The task panel displays input parameters in a key-value form where you configure each variable defined in your decorator individually. You can configure the variable source (static, job, or task) and specify static key-value pairs. ![](/_fern-img/ed1e7a7558e0978d14da729f591a6cb9240e2b2e61f027781ff91bb3d981a540.webp) **JSON code block:** To define input parameters as a single JSON code block, select **JSON Code Block** under **Parameters** in the task panel. ![](/_fern-img/3673521f4af08b38cc040922fd01d86305b2ef301adb2977e80bc9946b55bc9b.webp) ### Define gateway cluster and service variables You can use the **Gateway Cluster ID** and **Service Name** fields to specify which gateway cluster and service you want to run, or you can define the Gateway Cluster ID and service as input variables that receive data from elsewhere in the workflow. To use as variables: 1. Enable the **Gateway Cluster ID & Service: Use as Variable** toggle at the top of the task panel. 2. Define the source for the gateway cluster ID and service variables as static, job, or task to determine how these values will be passed to the **runService** task. ![](/_fern-img/355f85260a39acc64efbde92761094d68ed29f39005b3ed2d9c8d2c7c78279f2.webp) ## runService task output The **runService** task returns the gateway service's execution result as the task's output. Downstream tasks in your workflow can reference these fields directly. | Field | Description | | -------------------- | ------------------------------------------------------------------------------ | | `result.stdout` | Raw standard output from the service execution. | | `result.stdout_json` | The `stdout` content parsed as JSON. Present only when `stdout` is valid JSON. | | `result.stderr` | Standard error from the service execution. | | `result.return_code` | Process exit code. `0` indicates success. | To use an output field in a downstream task, set that task's input source to **task**, with **Previous Task** set to the **runService** task and **Task Variable** set to `result.stdout_json` or another result field. For the complete list of input and output fields, see [runService task reference](/itential-platform/studio/tasks/reference/run-service). > How to add gateway services to Itential Platform workflows using the runService task in Studio.