You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/sdks/typescript.mdx
+79-2Lines changed: 79 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -593,14 +593,91 @@ async function executeClientSideWorkflow() {
593
593
});
594
594
595
595
console.log('Workflow result:', result);
596
-
596
+
597
597
// Update UI with result
598
-
document.getElementById('result')!.textContent=
598
+
document.getElementById('result')!.textContent=
599
599
JSON.stringify(result.output, null, 2);
600
600
} catch (error) {
601
601
console.error('Error:', error);
602
602
}
603
603
}
604
+
```
605
+
606
+
### File Upload
607
+
608
+
File objects are automatically detected and converted to base64 format. Include them in your input under the field name matching your workflow's API trigger input format.
609
+
610
+
The SDK converts File objects to this format:
611
+
```typescript
612
+
{
613
+
type: 'file',
614
+
data: 'data:mime/type;base64,base64data',
615
+
name: 'filename',
616
+
mime: 'mime/type'
617
+
}
618
+
```
619
+
620
+
Alternatively, you can manually provide files using the URL format:
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/triggers/api.mdx
+57-2Lines changed: 57 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,17 @@ The API trigger exposes your workflow as a secure HTTP endpoint. Send JSON data
22
22
/>
23
23
</div>
24
24
25
-
Add an **Input Format** field for each parameter. Runtime output keys mirror the schema and are also available under `<api.input>`.
25
+
Add an **Input Format** field for each parameter. Supported types:
26
26
27
-
Manual runs in the editor use the `value` column so you can test without sending a request. During execution the resolver populates both `<api.userId>` and `<api.input.userId>`.
27
+
-**string** - Text values
28
+
-**number** - Numeric values
29
+
-**boolean** - True/false values
30
+
-**json** - JSON objects
31
+
-**files** - File uploads (access via `<api.fieldName[0].url>`, `<api.fieldName[0].name>`, etc.)
32
+
33
+
Runtime output keys mirror the schema and are available under `<api.input>`.
34
+
35
+
Manual runs in the editor use the `value` column so you can test without sending a request. During execution the resolver populates both `<api.fieldName>` and `<api.input.fieldName>`.
0 commit comments