Demo Search and Process Workflow

Searches for data and processes it

Back
Workflow Information

ID: demo_search_process

Namespace: default

Version: 1.0.0

Created: 2025-07-09

Updated: 2025-07-09

Tasks: 2

Quick Actions
Manage Secrets
Inputs
Name Type Required Default
search_query string Required Python programming
Outputs
Name Type Source
summary string Processed summary
search_results string Raw search results
Tasks
search_data
script

No description

process_results
script

No description

YAML Source
id: demo_search_process
name: Demo Search and Process Workflow
tasks:
- id: search_data
  type: script
  script: "import json\nimport os\n\nquery = os.environ.get('search_query', 'default')\n\
    # Simulate search results\nresults = {\n    \"query\": query,\n    \"results\"\
    : [\n        {\"title\": \"Result 1\", \"url\": \"https://example.com/1\"},\n\
    \        {\"title\": \"Result 2\", \"url\": \"https://example.com/2\"}\n    ],\n\
    \    \"count\": 2\n}\n\nprint(f\"__OUTPUTS__ {json.dumps(results)}\")\n"
- id: process_results
  type: script
  script: "import json\nimport os\n\n# Get search results from previous task\nsearch_output\
    \ = os.environ.get('search_data.output', '{}')\ndata = json.loads(search_output)\n\
    \n# Process the results\nsummary = {\n    \"total_results\": data.get(\"count\"\
    , 0),\n    \"processed\": True,\n    \"summary\": f\"Found {data.get('count',\
    \ 0)} results for query: {data.get('query', 'unknown')}\"\n}\n\nprint(f\"__OUTPUTS__\
    \ {json.dumps(summary)}\")\n"
  depends_on:
  - search_data
inputs:
- name: search_query
  type: string
  default: Python programming
  required: true
outputs:
  summary:
    source: process_results
    description: Processed summary
  search_results:
    source: search_data
    description: Raw search results
version: 1.0.0
description: Searches for data and processes it

No executions yet. Execute this workflow to see results here.