← ClaudeAtlas

create-ai-response-from-prompt-and-return-resultlisted

Build a Zap on Zapier that another workflow can call as a sub-zap, sending it a prompt and optional instructions, waiting for ChatGPT to finish, and returning the generated text. Use when a Zap or workflow needs a model response from a prompt and should get back the finished text, not a half-done request.
zapier/awesome-zaps · ★ 2 · AI & Automation · score 78
Install: claude install-skill zapier/awesome-zaps
# Create AI response from prompt and return result The Zap's code lives at https://github.com/zapier/awesome-zaps/tree/main/zaps/create-ai-response-from-prompt-and-return-result. Read the files there if this skill was installed on its own. ## What it does 1. **Trigger:** a calling Zap or workflow starts this sub-zap in Sub-Zap by Zapier (`sub-zap-by-zapier`, `start_subzap`) with a `prompt`, optional `instructions`, and an optional `model`. The sub-zap returns its output to the caller. 2. **Sanitize:** control characters are removed from the prompt and instructions, and the model defaults to `gpt-4o` when the caller sends none. An empty prompt returns right away without calling ChatGPT. 3. **ChatGPT** (`chatgpt`) submits the prompt as a Responses API request and keeps the response ID. 4. **Wait and check:** the workflow waits five minutes, then fetches the stored response from ChatGPT. It repeats until the response has text or the check limit is reached. 5. **Return:** the generated text goes back to the caller as `{ ok: true, text, responseId }`. If there is no text after the last check, it returns `{ ok: false, error }` instead. ## Ask the user This zap has no per-person values, so nothing is filled in before deploying. Ask the user these: - **Which ChatGPT (OpenAI) connection** the sub-zap should use. It must be connected before the workflow can run. - **Whether to keep the defaults**, which are worth reviewing with them: - `DEFAULT_MODEL` in `config.ts`: the model