cloud ui docs + cookbooks (#4759)
Co-authored-by: Ritik Sahni <ritiksahni0203@gmail.com> Co-authored-by: Kunal Mishra <kunalm2345@gmail.com>
This commit is contained in:
@@ -28,8 +28,10 @@ print(profile.browser_profile_id) # bpf_abc123
|
||||
|-----------|------|----------|-------------|
|
||||
| `name` | `str` | Yes | Display name for the profile. |
|
||||
| `description` | `str` | No | Optional description. |
|
||||
| `workflow_run_id` | `str` | No | The workflow run ID to snapshot. The run must have used `persist_browser_session=True`. |
|
||||
| `browser_session_id` | `str` | No | The browser session ID to snapshot. |
|
||||
| `workflow_run_id` | `str` | Conditional | The workflow run ID to snapshot. The run must have used `persist_browser_session=True`. Required if `browser_session_id` is not provided. |
|
||||
| `browser_session_id` | `str` | Conditional | The browser session ID to snapshot. Required if `workflow_run_id` is not provided. |
|
||||
|
||||
You must provide either `workflow_run_id` or `browser_session_id`.
|
||||
|
||||
### Returns `BrowserProfile`
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ versions = await client.get_workflow_versions(
|
||||
|
||||
```python
|
||||
updated = await client.update_workflow(
|
||||
workflow_id: str, # The version ID (not permanent ID).
|
||||
workflow_id: str, # The permanent ID (wpid_...).
|
||||
json_definition: dict | None = None,
|
||||
yaml_definition: str | None = None,
|
||||
) -> Workflow
|
||||
@@ -349,7 +349,7 @@ profile = await client.create_browser_profile(
|
||||
name: str,
|
||||
description: str | None = None,
|
||||
workflow_run_id: str | None = None, # Run must have used persist_browser_session=True.
|
||||
browser_session_id: str | None = None,
|
||||
browser_session_id: str | None = None, # One of workflow_run_id or browser_session_id is required.
|
||||
) -> BrowserProfile
|
||||
```
|
||||
|
||||
|
||||
@@ -107,15 +107,25 @@ Create a new workflow from a JSON or YAML definition.
|
||||
```python
|
||||
workflow = await client.create_workflow(
|
||||
json_definition={
|
||||
"blocks": [
|
||||
{
|
||||
"block_type": "task",
|
||||
"label": "extract_data",
|
||||
"prompt": "Extract the top 3 products",
|
||||
"url": "https://example.com/products",
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"title": "Extract Products",
|
||||
"workflow_definition": {
|
||||
"parameters": [
|
||||
{
|
||||
"key": "target_url",
|
||||
"parameter_type": "workflow",
|
||||
"workflow_parameter_type": "string",
|
||||
"description": "URL to scrape",
|
||||
}
|
||||
],
|
||||
"blocks": [
|
||||
{
|
||||
"block_type": "task",
|
||||
"label": "extract_data",
|
||||
"prompt": "Extract the top 3 products",
|
||||
"url": "{{ target_url }}",
|
||||
}
|
||||
],
|
||||
},
|
||||
},
|
||||
)
|
||||
print(workflow.workflow_permanent_id)
|
||||
@@ -229,17 +239,20 @@ Update an existing workflow's definition.
|
||||
|
||||
```python
|
||||
updated = await client.update_workflow(
|
||||
"wf_abc123",
|
||||
"wpid_abc123",
|
||||
json_definition={
|
||||
"blocks": [
|
||||
{
|
||||
"block_type": "task",
|
||||
"label": "extract_data",
|
||||
"prompt": "Extract the top 5 products",
|
||||
"url": "https://example.com/products",
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"title": "Extract Products",
|
||||
"workflow_definition": {
|
||||
"blocks": [
|
||||
{
|
||||
"block_type": "task",
|
||||
"label": "extract_data",
|
||||
"prompt": "Extract the top 5 products",
|
||||
"url": "https://example.com/products",
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
},
|
||||
},
|
||||
)
|
||||
print(f"Updated to v{updated.version}")
|
||||
@@ -249,7 +262,7 @@ print(f"Updated to v{updated.version}")
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `workflow_id` | `str` | Yes | The workflow version ID (not the permanent ID). |
|
||||
| `workflow_id` | `str` | Yes | The workflow's permanent ID (`wpid_...`). |
|
||||
| `json_definition` | `WorkflowCreateYamlRequest` | No | Updated workflow definition as JSON. |
|
||||
| `yaml_definition` | `str` | No | Updated workflow definition as YAML. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user