Skip to content

Commit 1a70c43

Browse files
marcel-rbroclaude
andcommitted
docs: Enhance output schema template property documentation
Improve the documentation for the `template` property in output schemas by expanding the property description and adding a comprehensive "Understanding templates" section that explains template processing, syntax, and where generated URLs appear. Changes: - Enhanced template property description with Mustache syntax details - Added "Understanding templates" section explaining: - How the platform processes templates (interpolation, generation, display) - Template syntax with concrete examples - Where templates appear (Console and API) Addresses feedback from GitHub issue #2165. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 107b89c commit 1a70c43

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

  • sources/platform/actors/development/actor_definition/output_schema

sources/platform/actors/development/actor_definition/output_schema/index.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The output schema defines the collections of keys and their properties. It allow
7373
|----------------|--------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
7474
| `title` | string | true | The output's title, shown in the run's output tab if there are multiple outputs and in API as key for the generated output URL. |
7575
| `description` | string | false | A description of the output. Only used when reading the schema (useful for LLMs) |
76-
| `template` | string | true | Defines a template which will be translated into output URL. The template can use variables (see below) |
76+
| `template` | string | true | Defines a URL template that generates the output link. Templates use Mustache-style variable interpolation with {{variable}} syntax. The generated URL appears in the Apify Console Output tab and in the API response's output property. |
7777

7878
### Available template variables
7979

@@ -90,6 +90,32 @@ The output schema defines the collections of keys and their properties. It allow
9090
| `run.defaultDatasetId` | string | ID of the default dataset |
9191
| `run.defaultKeyValueStoreId` | string | ID of the default key-value store |
9292

93+
## Understanding templates
94+
95+
Templates allow you to dynamically generate URLs that point to your Actor's output. When an Actor run completes, the Apify platform processes each template by:
96+
97+
1. **Variable interpolation**: Replacing `{{variable}}` placeholders with actual runtime values
98+
2. **URL generation**: Creating the final output URL
99+
3. **Display**: Showing the output in the Apify Console Output tab and including it in the API response
100+
101+
### Template syntax
102+
103+
Templates use Mustache-style double curly braces `{{variable}}` for variable interpolation. For example:
104+
105+
- `{{links.apiDefaultDatasetUrl}}/items` becomes `https://api.apify.com/v2/datasets/<dataset-id>/items`
106+
- `{{run.containerUrl}}` becomes `https://<container-id>.runs.apify.net/`
107+
108+
You can access nested properties using dot notation (e.g., `{{run.defaultDatasetId}}`, `{{links.publicRunUrl}}`).
109+
110+
### Where templates appear
111+
112+
The generated URLs from your templates appear in two places:
113+
114+
1. **Apify Console**: In the Output tab of your Actor run
115+
2. **API Response**: In the `output` property when calling the GET Run endpoint
116+
117+
The examples below demonstrate various template patterns and their results in both the Console and API.
118+
93119
## Examples
94120

95121
### Linking default dataset

0 commit comments

Comments
 (0)