Zapgpt Environment
Six utility workflows backing the ZapGPT agent: SearXNG web/image search, GDELT news search and content extraction, image-URL-to-storage download, and yt-dlp media downloads with storage.
workflow manual http search images media-download news gdelt yt-dlp searxng download-to-storage
What's Included
This example contains 6 documents:
| # | Name | Details |
|---|---|---|
| 1 | SearXNG Search | Trigger: manual |
| 2 | SearXNG Image Search | Trigger: manual |
| 3 | Image URL To Storage | Trigger: manual |
| 4 | GDELT News Search | Trigger: manual |
| 5 | GDELT News Content | Trigger: manual |
| 6 | yt-dlp Media Download To Storage | Trigger: manual |
Full JSON
Click to expand
{
"description": "Six utility workflows backing the ZapGPT agent: SearXNG web/image search, GDELT news search and content extraction, image-URL-to-storage download, and yt-dlp media downloads with storage.",
"tags": [
"workflow",
"manual",
"http",
"search",
"images",
"media-download",
"news",
"gdelt",
"yt-dlp",
"searxng",
"download-to-storage"
],
"linkedExamples": [
{
"type": "agents",
"variant": "zapgpt-environment",
"relationship": "The LLM agent whose tools invoke these workflows via execute_workflow_manual."
}
],
"documents": [
{
"name": "SearXNG Search",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "query",
"description": "Search query sent to the SearXNG instance.",
"schema": {
"type": "string",
"required": true
}
},
{
"name": "categories",
"description": "Optional comma-separated SearXNG categories, such as general,news,images.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "language",
"description": "Optional language code such as en-US or pt-BR.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "time_range",
"description": "Optional time range filter: day, month, or year.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "pageno",
"description": "Optional results page number.",
"schema": {
"type": "string",
"required": false
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://<your-searxng-instance>/search\", {\"q\": query, \"format\": \"json\", \"categories\": categories, \"language\": language, \"time_range\": time_range, \"pageno\": pageno})",
"onFailure": "fallback"
},
"headers": [
{
"key": {
"expr": "\"Accept\""
},
"value": {
"expr": "\"application/json\""
}
}
],
"cache": false
}
}
}
],
"returnExpression": {
"expr": "step_ok(0) ? {\n \"ok\": true,\n \"query\": step_data(0, \"query\", query),\n \"number_of_results\": step_data(0, \"number_of_results\", 0),\n \"results\": step_data(0, \"results\", []),\n \"suggestions\": step_data(0, \"suggestions\", []),\n \"infoboxes\": step_data(0, \"infoboxes\", []),\n \"error\": null\n} : {\n \"ok\": false,\n \"query\": query,\n \"status\": get(step(0), \"status\"),\n \"data\": step_data(0),\n \"error\": defaults(step_error(0), {\n \"code\": get(step(0), \"status\") != null ? \"http_request_failed\" : \"workflow_step_failed\",\n \"user_message\": coalesce(step_data(0, \"error\"), step_data(0, \"message\"), \"Search request failed.\"),\n \"retryable\": false\n })\n}",
"onFailure": "fallback"
}
},
{
"name": "SearXNG Image Search",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "query",
"description": "Search query sent to the SearXNG instance.",
"schema": {
"type": "string",
"required": true
}
},
{
"name": "language",
"description": "Optional language code such as en-US or pt-BR.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "limit",
"description": "Optional number of image results to return. Defaults to 10, with a hard cap of 25.",
"schema": {
"type": "number",
"required": false
}
},
{
"name": "pageno",
"description": "Optional results page number.",
"schema": {
"type": "string",
"required": false
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://<your-searxng-instance>/search\", {\"q\": query, \"categories\": \"images\", \"format\": \"json\", \"language\": language, \"pageno\": pageno})",
"onFailure": "fallback"
},
"headers": [
{
"key": {
"expr": "\"Accept\""
},
"value": {
"expr": "\"application/json\""
}
}
],
"cache": false
}
}
}
],
"returnExpression": {
"expr": "step_ok(0) ? {\"ok\": true, \"query\": step_data(0, \"query\", query), \"search_status\": get(step(0), \"status\"), \"limit_requested\": coalesce(limit, 10), \"limit_applied\": math_clamp(coalesce(limit, 10), 1, 25), \"total_results\": step_data(0, \"number_of_results\", size(step_data(0, \"results\", []))), \"number_of_results\": size(slice(step_data(0, \"results\", []), 0, math_clamp(coalesce(limit, 10), 1, 25))), \"images\": slice(step_data(0, \"results\", []), 0, math_clamp(coalesce(limit, 10), 1, 25)), \"suggestions\": step_data(0, \"suggestions\", []), \"error\": null} : {\"ok\": false, \"query\": query, \"status\": get(step(0), \"status\"), \"data\": step_data(0), \"error\": defaults(step_error(0), {\"code\": get(step(0), \"status\") != null ? \"image_search_request_failed\" : \"workflow_step_failed\", \"user_message\": coalesce(step_data(0, \"error\"), step_data(0, \"message\"), \"Image search request failed.\"), \"retryable\": false})}",
"onFailure": "fallback"
}
},
{
"name": "Image URL To Storage",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "url",
"description": "Direct image URL to download and store.",
"schema": {
"type": "string",
"required": true
}
},
{
"name": "file_name",
"description": "Optional file name to use when storing the image.",
"schema": {
"type": "string",
"required": false
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/download-to-storage",
"actions/network/http/download-to-storage": {
"url": {
"expr": "url",
"onFailure": "fallback"
},
"headers": [],
"fileName": {
"expr": "present(file_name) ? trim(file_name) : null",
"onFailure": "fallback"
},
"category": "images",
"isPublic": false
}
}
}
],
"returnExpression": {
"expr": "step_ok(0) && get(step(0), \"file\") != null ? {\"ok\": true, \"url\": url, \"status\": get(step(0), \"status\"), \"stored_file\": get(step(0), \"file\"), \"signed_url\": get(step(0), \"signedUrl\"), \"content_type\": get(step(0), \"contentType\"), \"size\": get(step(0), \"size\"), \"error\": null} : {\"ok\": false, \"url\": url, \"status\": get(step(0), \"status\"), \"stored_file\": get(step(0), \"file\"), \"signed_url\": get(step(0), \"signedUrl\"), \"content_type\": get(step(0), \"contentType\"), \"size\": get(step(0), \"size\"), \"error\": defaults(step_error(0), {\"code\": get(step(0), \"status\") != null && get(step(0), \"status\", 0) != 200 ? \"http_download_failed\" : \"image_storage_failed\", \"user_message\": get(step(0), \"status\") != null && get(step(0), \"status\", 0) != 200 ? \"Could not download the image from the provided URL.\" : \"Could not prepare the image for delivery.\", \"retryable\": false})}",
"onFailure": "fallback"
}
},
{
"name": "GDELT News Search",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "query",
"description": "Search keyword or GDELT DOC query string.",
"schema": {
"type": "string",
"required": true
}
},
{
"name": "mode",
"description": "Optional GDELT DOC mode. Defaults to ArtList.",
"schema": {
"type": "string",
"required": false,
"enableEnums": true,
"enum": [
"ArtList",
"TimelineVol",
"TimelineTone"
]
}
},
{
"name": "timespan",
"description": "Optional relative time window such as 15min, 3h, 7d, 2w, or 1m.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "startdatetime",
"description": "Optional absolute start datetime in YYYYMMDDHHMMSS.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "enddatetime",
"description": "Optional absolute end datetime in YYYYMMDDHHMMSS.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "maxrecords",
"description": "Optional maximum number of results to request, from 1 to 10000.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "sort",
"description": "Optional sort order.",
"schema": {
"type": "string",
"required": false,
"enableEnums": true,
"enum": [
"datedesc",
"dateasc",
"tonedesc",
"toneasc"
]
}
},
{
"name": "domain",
"description": "Optional source domain filter, such as reuters.com.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "theme",
"description": "Optional GDELT theme filter.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "sourcelang",
"description": "Optional source language filter.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "sourcecountry",
"description": "Optional source country filter.",
"schema": {
"type": "string",
"required": false
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://<your-gdelt-proxy>/doc\", {\"query\": query, \"format\": \"json\", \"mode\": present(mode) ? trim(mode) : \"ArtList\", \"timespan\": timespan, \"startdatetime\": startdatetime, \"enddatetime\": enddatetime, \"maxrecords\": maxrecords, \"sort\": sort, \"domain\": domain, \"theme\": theme, \"sourcelang\": sourcelang, \"sourcecountry\": sourcecountry})",
"onFailure": "fallback"
},
"headers": [
{
"key": {
"expr": "\"Accept\""
},
"value": {
"expr": "\"application/json\""
}
}
],
"cache": false
}
}
}
],
"returnExpression": {
"expr": "step_ok(0) ? {\n \"ok\": true,\n \"query\": query,\n \"mode\": present(mode) ? trim(mode) : \"ArtList\",\n \"request\": {\n \"timespan\": timespan,\n \"startdatetime\": startdatetime,\n \"enddatetime\": enddatetime,\n \"maxrecords\": maxrecords,\n \"sort\": sort,\n \"domain\": domain,\n \"theme\": theme,\n \"sourcelang\": sourcelang,\n \"sourcecountry\": sourcecountry\n },\n \"article_count\": size(step_data(0, \"articles\", [])),\n \"articles\": step_data(0, \"articles\", []),\n \"timeline\": step_data(0, \"timeline\", []),\n \"data\": step_data(0),\n \"error\": null\n} : {\n \"ok\": false,\n \"query\": query,\n \"mode\": present(mode) ? trim(mode) : \"ArtList\",\n \"status\": get(step(0), \"status\"),\n \"data\": step_data(0),\n \"error\": defaults(step_error(0), {\n \"code\": get(step(0), \"status\") != null ? \"http_request_failed\" : \"workflow_step_failed\",\n \"user_message\": coalesce(step_data(0, \"error\"), step_data(0, \"message\"), \"News search request failed.\"),\n \"retryable\": false\n })\n}",
"onFailure": "fallback"
}
},
{
"name": "GDELT News Content",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "url",
"description": "Article URL to fetch and extract with GDELT DOC content.",
"schema": {
"type": "string",
"required": true
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://<your-gdelt-proxy>/doc/content\", {\"url\": url})",
"onFailure": "fallback"
},
"headers": [
{
"key": {
"expr": "\"Accept\""
},
"value": {
"expr": "\"application/json\""
}
}
],
"cache": false
}
}
}
],
"returnExpression": {
"expr": "step_ok(0) ? {\n \"ok\": true,\n \"url\": url,\n \"title\": step_data(0, \"title\"),\n \"content\": coalesce(step_data(0, \"content\"), step_data(0, \"text\"), step_data(0, \"full_text\")),\n \"data\": step_data(0),\n \"error\": null\n} : {\n \"ok\": false,\n \"url\": url,\n \"status\": get(step(0), \"status\"),\n \"data\": step_data(0),\n \"error\": defaults(step_error(0), {\n \"code\": get(step(0), \"status\") != null ? \"http_request_failed\" : \"workflow_step_failed\",\n \"user_message\": coalesce(step_data(0, \"error\"), step_data(0, \"message\"), \"Could not extract the article content.\"),\n \"retryable\": false\n })\n}",
"onFailure": "fallback"
}
},
{
"name": "yt-dlp Media Download To Storage",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "url",
"description": "URL supported by yt-dlp, such as YouTube, Instagram, TikTok, X/Twitter, Facebook, Vimeo, Reddit, SoundCloud, and many others.",
"schema": {
"type": "string",
"required": true
}
},
{
"name": "media_type",
"description": "Media type to download: video or audio. Defaults to video.",
"schema": {
"type": "string",
"required": false,
"enableEnums": true,
"enum": [
"video",
"audio"
]
}
},
{
"name": "quality",
"description": "Optional video quality such as 720 or 1080. Ignored for audio downloads.",
"schema": {
"type": "string",
"required": false
}
},
{
"name": "audio_format",
"description": "Optional audio format when media_type is audio. Defaults to mp3.",
"schema": {
"type": "string",
"required": false
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "POST",
"url": {
"expr": "\"https://<your-ytdlp-instance>/\"",
"onFailure": "fallback"
},
"headers": [
{
"key": {
"expr": "\"Accept\""
},
"value": {
"expr": "\"application/json\""
}
},
{
"key": {
"expr": "\"Content-Type\""
},
"value": {
"expr": "\"application/json\""
}
},
{
"key": {
"expr": "\"Authorization\""
},
"value": {
"expr": "\"Api-Key <your-api-key>\""
}
}
],
"body": {
"expr": "(present(media_type) ? trim(media_type) : \"video\") == \"audio\" ? json_stringify({\"url\": url, \"format\": \"audio\", \"audio_format\": present(audio_format) ? trim(audio_format) : \"mp3\"}) : (present(quality) ? json_stringify({\"url\": url, \"quality\": trim(quality)}) : json_stringify({\"url\": url}))",
"onFailure": "fallback"
},
"cache": false
}
}
},
{
"condition": {
"expr": "get(step(0), \"status\") == 200 && present(step_data(0, \"download_url\"))",
"onFailure": "fallback"
},
"action": {
"actionType": "actions/network/http/download-to-storage",
"actions/network/http/download-to-storage": {
"url": {
"expr": "step_data(0, \"download_url\")",
"onFailure": "fallback"
},
"headers": [],
"fileName": {
"expr": "coalesce(step_data(0, \"filename\"), ((present(media_type) ? trim(media_type) : \"video\") == \"audio\" ? \"downloaded-audio.mp3\" : \"downloaded-video.mp4\"))",
"onFailure": "fallback"
},
"isPublic": false
}
}
}
],
"returnExpression": {
"expr": "get(step(1), \"file\") != null ? {\"ok\": true, \"url\": url, \"media_type\": (present(media_type) ? trim(media_type) : \"video\"), \"provider_status\": step_data(0, \"status\"), \"download_url\": step_data(0, \"download_url\"), \"filename\": step_data(0, \"filename\"), \"stored_file\": get(step(1), \"file\"), \"signed_url\": get(step(1), \"signedUrl\"), \"content_type\": get(step(1), \"contentType\"), \"size\": get(step(1), \"size\"), \"provider_response\": step_data(0), \"error\": null} : {\"ok\": false, \"url\": url, \"media_type\": (present(media_type) ? trim(media_type) : \"video\"), \"provider_status\": step_data(0, \"status\"), \"download_url\": step_data(0, \"download_url\"), \"filename\": step_data(0, \"filename\"), \"stored_file\": get(step(1), \"file\"), \"signed_url\": get(step(1), \"signedUrl\"), \"content_type\": get(step(1), \"contentType\"), \"size\": get(step(1), \"size\"), \"provider_response\": step_data(0), \"error\": {\"code\": step_error(0) != null ? coalesce(get(step_error(0), \"code\"), \"download_request_failed\") : (get(step(0), \"status\", 0) != 200 ? \"download_request_failed\" : (!present(step_data(0, \"download_url\")) ? \"download_url_missing\" : (step_error(1) != null ? coalesce(get(step_error(1), \"code\"), \"storage_download_failed\") : \"storage_download_failed\"))), \"user_message\": step_error(0) != null ? coalesce(get(step_error(0), \"user_message\"), \"Could not download the media.\") : (get(step(0), \"status\", 0) != 200 ? coalesce(step_data(0, \"error\"), step_data(0, \"message\"), \"Could not download the media.\") : (!present(step_data(0, \"download_url\")) ? coalesce(step_data(0, \"text\"), step_data(0, \"error\"), step_data(0, \"message\"), \"The source did not provide a download link for this media.\") : coalesce(get(step_error(1), \"user_message\"), \"Could not save the media for delivery.\"))), \"retryable\": coalesce(get(step_error(0), \"retryable\"), get(step_error(1), \"retryable\"), false)}}",
"onFailure": "fallback"
}
}
]
}
How to Import
- Download the ZIP file using the button above
- Navigate to Company Settings → Data Transfer in your AutoTalk dashboard
- Click Import and select the downloaded ZIP file
- Review the import summary and confirm
- All document IDs are automatically remapped — no manual ID editing needed
Configuration Required
After importing, update the following placeholders with your actual values:
<your-searxng-instance><your-gdelt-proxy><your-ytdlp-instance><your-api-key>