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: docs/docs/Components/components-processing.md
+76
Original file line number
Diff line number
Diff line change
@@ -389,6 +389,82 @@ This component converts and extracts JSON fields using JQ queries.
389
389
|------|--------------|------|
390
390
| filtered_data | Filtered Data | Filtered data as list of [Data](/concepts-objects#data-object) objects. |
391
391
392
+
393
+
## Save to File
394
+
395
+
This component saves [DataFrames, Data, or Messages](/concepts-objects) to various file formats.
396
+
397
+
1. To use this component in a flow, connect a component that outputs [DataFrames, Data, or Messages](/concepts-objects) to the **Save to File** component's input.
398
+
The following example connects a **Webhook** component to two **Save to File** components to demonstrate the different outputs.
399
+
400
+

401
+
402
+
2. In the **Save to File** component's **Input Type** field, select the expected input type.
403
+
This example expects **Data** from the **Webhook**.
404
+
3. In the **File Format** field, select the file type for your saved file.
405
+
This example uses `.md` in one **Save to File** component, and `.xlsx` in another.
406
+
4. In the **File Path** field, enter the path for your saved file.
407
+
This example uses `./output/employees.xlsx` and `./output/employees.md` to save the files in a directory relative to where Langflow is running.
408
+
The component accepts both relative and absolute paths, and creates any necessary directories if they don't exist.
409
+
:::tip
410
+
If you enter a format in the `file_path` that is not accepted, the component appends the proper format to the file.
411
+
For example, if the selected `file_format` is `csv`, and you enter `file_path` as `./output/test.txt`, the file will be saved as `./output/test.txt.csv` so the file is not corrupted.
412
+
:::
413
+
5. Send a POST request to the **Webhook** containing your JSON data.
414
+
Replace `YOUR_FLOW_ID` with your flow ID.
415
+
This example uses the default Langflow server address.
416
+
```text
417
+
curl -X POST "http://127.0.0.1:7860/api/v1/webhook/YOUR_FLOW_ID" \
0 commit comments