# AI on viaSocket, and steps that wait Back to the skill: https://viasocket.com/docs/skill.md. The functions named here (`findEnabledApp`, `runAction`, `listFlows`, …) are in the module of https://viasocket.com/docs/apps-api.md Contents: Where each AI thing lives; Which action, in a flow; Every AI built-in, as a step; A step that waits; Example: sort support tickets, cheaply; Finished when Everything AI a product or a workflow can use, each with its page. Below it: which AI action suits which job in a flow, every AI built-in live from the catalog, and what a step that waits means for the flow and its caller. ## Where each AI thing lives | the product or the workflow needs… | read | | --- | --- | | AI as one step of a flow: write, classify, decide, summarise, translate, transcribe, draw | this page | | an assistant in the product, or AI behind a feature: a choice of models, the product’s endpoints and any MCP server as tools, images, documents and a browser it drives itself | https://viasocket.com/docs/ai.md | | AI behind a feature with no conversation (a "Summarise" button that answers in the same request): Run AI Model as the one step of a webhook flow answers the call with that step’s return; the AI API’s `delivery: "sync"` answers too and adds threads, attachments, tools and a browser | this page, or https://viasocket.com/docs/ai.md | | the same AI on the user’s own Claude account (their login token or API key, connected once as the Claude Connector app), in the product or as a step of a flow | https://viasocket.com/docs/ai.md, section 2 “On the user’s own Claude account” | | AI memory: each user’s facts, rules and corrections, which they can see and delete | https://memory-api.viasocket.com/guide.md | | the product’s own agent (LangChain, Vercel AI SDK, any framework) on its own model, with its users’ connected apps as tools: one tool per action, run through the enabled app; none of viaSocket’s AI is used | https://viasocket.com/docs/skill/agent-tools.md; with the viasocket-apps package: https://github.com/Walkover-Web-Solution/viasocket-apps#agent-tools | | the product usable from Claude, ChatGPT and other agents: its own MCP server; MCP servers its users make | https://viasocket.com/docs/skill/mcp.md | ## Which action, in a flow | the step must… | use | the result | | --- | --- | --- | | write, summarise, extract or classify text, and the next step needs it now | Run AI Model (`Run_AI_Model`) | in the same run: `content` (text, or JSON text with `response_type: "json_object"`), `model`, `credits_used` | | the same work at half the price, when nobody is waiting for the answer, or when the AI may take longer than a minute | Run AI Model in Background (`Run_AI_Model_in_Background`) | later: the run stops at this step and continues when the reply arrives: `content`, `model`, `credits_used` | | answer yes or no, pick one of the options you name, or give a score, with how sure it is, now (it does not wait, and is not the cheaper path) | Decision Maker (`Decision_Maker`) | in the same run: `answers..answer` and `confidence`, one per question | | create or edit an image | AI Image Generator (`AI_Image_Generator`) | later, like Run AI Model in Background | | wait for a person to approve, reject or choose | Send Approval Email (`Send_Approval_Email`, app `email`, not AI) | later: the run stops at this step and continues with the person’s reply | | translate, transcribe audio, turn an image and a sound into a video | the matching row in the table below | in the same run | | summarise a text, or turn loose text into JSON fields | Summarize Text, Convert to JSON (https://viasocket.com/docs/skill/built-in-actions.md) | in the same run | - **Run AI Model** takes `query` (the text and the ask), `prompt` (standing instructions) and `reasoning` (`low`, `medium`, `high`); send `response_type: "json_object"` with `response_json_structure` when the next step reads fields rather than prose. Its page: https://viasocket.com/docs/viasocket-utilities/run-ai-model.md. - **Run AI Model in Background** takes one `query` and nothing else: no `prompt`, no JSON mode, so the instruction goes inside the query and the reply is text. It queues the message at half the price of Run AI Model; the run stops at this step and continues when the reply arrives, so the 58-second limit of a run never applies to the AI’s thinking time. Its page: https://viasocket.com/docs/viasocket-utilities/run-ai-model-in-background.md. With no flow, the product’s backend gets the same price by sending many messages in one call: https://viasocket.com/docs/ai.md, section 8. - **Decision Maker** takes `user_message` (the text to judge), `question_type` (`noul`: yes or no, spelled so; `choice`: pick one; `score`: a number on a scale), `question_count` and `questions`. `questions` holds, for question number i, `q_key` (a short name with no spaces; the result appears under it), `q_instructions` (the question) and, for `choice` or `score`, `q_criteria` (an object: option name → when to pick it; or level number → what it means). The result is `answers.` with `answer`, `confidence` and, for yes or no, `probability_yes`. It runs on Jev, viaSocket’s own model for decisions. Made for sorting tickets, routing leads and flagging risk: the next step branches on the decision instead of parsing prose. Its page: https://viasocket.com/docs/decisionmaker/decision-maker.md. ## Every AI built-in, as a step The plugs the catalog tags AI (some are also under Documents or Network on https://viasocket.com/docs/skill/built-in-actions.md), plus the two utilities AI actions, live. Each action’s page is `https://viasocket.com/docs//.md`. | Built in | Use it to | app slug · event | key | `action_id` | `auth_id` | `pauses` | | --- | --- | --- | --- | --- | --- | --- | | Run AI Model | Write, classify, extract, read a page it is given a URL for, or search the web; the prompt decides the job. | `viasocket-utilities` · `run-ai-model` | `Run_AI_Model` `v4` | `rowskkqydb6f` | `NoAuth` | | | Run AI Model in Background | The same job at a lower price when the reply can come later; the run continues from the next step when it does. | `viasocket-utilities` · `run-ai-model-in-background` | `Run_AI_Model_in_Background` `v1` | `rowhjikegc45` | `NoAuth` | `async` | | AI Image Generator | Create or edit images with AI | `image-generator` · `ai-image-generator` | `AI_Image_Generator` `v8` | `rowmjzkcfmmx` | `NoAuth` | `async` | | Convert to JSON | Converts text or key-value inputs into a structured format usable by other tools. | `json_converter` · `convert-to-json` | `Convert_to_JSON` `v4` | `row54shumutg` | `NoAuth` | | | Extract Website Data | Extract data from a website and return it in specified formats. | `WebScrapingOrCrawling` · `extract-website-data` | `Extract_Website_Data` `v21` | `rowgwfy8tllu` | `NoAuth` | | | Decision Maker | Evaluate input using configured yes/no, choice, or score questions and return decisions with confidence. | `decisionmaker` · `decision-maker` | `Decision_Maker` `v4` | `row1yu6cpp0q` | `NoAuth` | | | Add Audio to Image | Combine an image and an audio track to create a video. | `audio-image` · `add-audio-to-image` | `Add_Audio_to_Image` `v4` | `rowyks7n6hdh` | `NoAuth` | | | LinkedIn Profile Scraper | Extract key fields (name, headline, company, location, experience, education, image) from a public LinkedIn p… | `linkdinscraper` · `linkedin-profile-scraper` | `LinkedIn_Profile_Scraper` `v4` | `rowj60i92jbu` | `NoAuth` | `async` | | Resume Parser | Extract a candidate's name, contact info, skills, work experience, and education from a resume or CV (PDF, DO… | `resumeinbuilt` · `resume-parser` | `Resume_Parser` `v6` | `row82cu6u8sb` | `NoAuth` | `async` | | Summarize Text | Create a concise summary of the provided text. | `text_summarizer` · `summarize-text` | `Summarize_Text` `v3` | `row1z1uega4f` | `NoAuth` | | | Transcribe Audio | Convert an audio file into a transcript with tone, a short summary, and key points. | `speech-to-text` · `transcribe-audio` | `Transcribe_Audio` `v10` | `rowchi48nmy6` | `NoAuth` | | | Translate Text | Translates the provided text into the selected language. | `text_translater` · `translate-text` | `Translate_Text` `v3` | `rowcyx7qgysg` | `NoAuth` | | Run one from code like any action (https://viasocket.com/docs/apps-api.md), or register it in a step of an automation (https://viasocket.com/docs/automations.md). A paid action (Run AI Model and the like) is refused while the workspace’s plan or the project is out of credits: the failure’s message says so (`Plan credits are exhausted…` or `…credits limit for the billing period…`), and it is not a thing to retry. ## A step that waits An action whose `pauses` is set (`async`: the app’s reply; `delay`: a set time; `intervention`: a person) ends the run at that step. viaSocket keeps the run, and when the reply comes it continues from the next step; the waiting step’s result, read at `context.res.`, is then the reply. - **In a test, the step answers at once with a placeholder:** `message` ("Your request has been queued…"), `batch_id`, and the reply’s keys empty (`content`, `model`, `credits_used`). Map the next step from those keys; the values are real in a real run, and the run history shows them. - **The caller gets no reply.** A webhook flow answers its caller with the last step’s return (or a `customResponse` text, https://viasocket.com/docs/automations.md); when the run stops at a waiting step, the call ends before the reply exists. A step after it carries the reply out: a call to the product’s own endpoint (`axios.post` in the step’s code), or a write to an app. - **A wait is not a timeout.** 58 seconds is the limit of one run’s code; a waiting step is outside it. Never sleep or poll in a step. - **Only in a flow.** An enabled app’s one-shot run answers once and cannot continue later, so an action with `pauses` set is always a step of a flow (https://viasocket.com/docs/skill/actions-and-events.md, "Flow or enabled app"). Three more actions wait the same way and are not AI: **Send Approval Email** of the Email app (`email`, key `Send_Approval_Email`, `action_id` `row397b6n1dt`; `intervention`), which emails a person a message with buttons; the button they press is the reply, and the run continues with it, https://viasocket.com/docs/email/send-approval-email.md; and LinkedIn Profile Scraper and Resume Parser (`async` on https://viasocket.com/docs/skill/built-in-actions.md). ## Example: sort support tickets, cheaply The product POSTs each ticket to the flow. The AI’s reply arrives later; the second step hands it to the product. ```js const classify = ` return await runAiInBackground({ inputData: { query: "Classify this support ticket as billing, bug or question. Reply with the one word only.\\n\\n" + (context?.req?.body?.text || "") }})` const deliver = ` const category = (context?.res?.classify?.content || "").trim() if (context?.res?.classify?.error || !category) return { skipped: true } // empty in a test: the reply is real only in a run return await axios.post("https://your-product.com/api/tickets/" + context?.req?.body?.id + "/category", { category }, { headers: { "x-key": "" } })` // : a key the product made for this flow; step code lives on viaSocket, so never a viaSocket secret here await saveSteps(token, scriptId, [ { stepname: 'classify', code: classify, service_action_functions: [{ name: 'runAiInBackground', auth_id: 'NoAuth', action_id: 'rowhjikegc45' }] }, { stepname: 'deliver', code: deliver, service_action_functions: [] } ]) ``` The same flow with Run AI Model in place of Run AI Model in Background answers the POST with the category in the same call, at twice the price: choose by whether someone is waiting. `saveSteps` is the automations module’s call (https://viasocket.com/docs/automations.md); for the product’s own automations the same steps go through Save Steps on https://viasocket.com/docs/skill/my-automations.md. ## Finished when - The job named the action by this page’s tables, and the report says why. - A step that waits was followed by the step that uses or delivers its reply, never read in the same step. - One real run showed the reply in the run history, not only the placeholder. END OF PAGE