
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@voiceflow/runtime
Advanced tools
runtime SDK for executing voiceflow projects and conversational state management across different platforms.
⚠️ This repository is still undergoing active development: Major breaking changes may be pushed periodically and the documentation may become outdated - a stable version has not been released
yarn add @voiceflow/runtime
npm i @voiceflow/runtime

At a very high level, you can think of the whole Voiceflow system like code:
diagrams is like a function/instruction.diagrams are "compiled" into programsruntime is like the CPU that reads these programs and executes them based on end user input.programs can be read through Local Project Files or through an Voiceflow API where they are hosted with Voiceflow databasesWhere conversational state management differs from traditional code execution is that it is heavily I/O based and always blocked when awaiting user input:
It is important to understand the Conversation Request/Response Webhook Model

The end user session storage is determined by the implementation of the runtime, but stores the most sensitive data in this architecture (what the user has said, where they are in the conversation, variables, etc.)
As a practical example, here's what happens when a user speaks to a custom skill (app) on their Alexa device. Most other conversational platforms function in this manner - if it is a text/or chat, it would be the exact same, just without a voice-to-text/text-to-voice layer.
alexa-runtime, which implements @voiceflow/runtimerepeat all steps each time a user speaks to the alexa skill, to perform a conversation. (here's Amazon Alexa's documentation)
import Client, { LocalDataApi } from '@voiceflow/runtime';
import CustomHandlers from './handlers';
const client = new Client({
handlers: {
...DefaultHandlers,
...CustomHandlers,
},
api: new LocalDataApi({ projectSource: PROJECT_SOURCE /* local project file */ }),
});
// if you want to inject custom handlers during lifecycle events
client.setEvent(EventType.handlerDidCatch, (err, runtime) => {
logger.log(err);
throw err;
});
Client can be initialized with either LocalDataApi, which reads a local file for project and program source, or ServerDataApi, which requires an API key (adminToken) and endpoint (dataEndpoint) and fetches the data remotely.
// incoming webhook request
const handleRequest = async (userID, versionID, payload) => {
// retrieve the previous user state
const rawState = DB.fetchState(userID);
const runtime = client.createRuntime(versionID, rawState, payload);
// update the state and generate new runtime (step through the program)
runtime.update();
// save the new user state
DB.saveState(userID, runtime.getFinalState());
// generate a response based on trace
let response = {};
runtime.trace.forEach((trace) => {
if (trace.type === 'card') response.card = trace.payload;
if (trace.type === 'speak') response.speak += trace.payload;
});
return response; // the SDK usually handles this
};
import { HandlerFactory } from '@voiceflow/runtime';
// create a handler for a particular node type
export const CustomNodeHandler: HandlerFactory<Node, typeof utilsObj> = (utils) => ({
// return a boolean whether or not this handler can handle a particular node
canHandle: (node) => {
return node.type === 'CUSTOM_NODE' && typeof node.custom === 'string';
},
// perform side effects and return the next node to go to
handle: (node, runtime, variables) => {
if (runtime.storage.get('customSetting')) {
// add something to the trace to help generate the response
runtime.trace.addTrace({
type: 'card',
payload: node.custom,
});
// maybe add something to analytics when this block is triggered
metrics.log(node.custom);
}
// if you return null it will immediately end the current flow
return node.nextId;
},
});
Return Types
null: ends the current flow, and pops it off the stacknodeID: as long as the nodeID is present in the current flow program, it will attempt to be handled next - if it is not found, same behavior as return nullnodeID: if the handler's handle() returns the same nodeID as the node it is handling, then the execution of this interaction (runtime.update()) will end in the exact same state and wait for the next user interaction/webhook. The next request will begin on this same node. You would do this to await user input. Example: Choice Noderequest: what the end user has done (intent, push button, etc)
runtime: general purpose object that provides an API to manipulate state
platform: alexa, google, IVR, messenger, slack, twilio, etc.
frame: program frame - contains local variables, pointers, etc.
stack: stack of program frames (like code execution stack)
program: flow program object (equivalent to text/code in memory model) (READ ONLY)
node: node metadata - each individual step/block in the program
variables: global variables
storage: object full of things you want to persist between requests
turn: object full of things that only matter during this turn
handlers: array of handlers that handle specific node functionalities
FAQs
Runtime for executing voiceflow projects
The npm package @voiceflow/runtime receives a total of 35 weekly downloads. As such, @voiceflow/runtime popularity was classified as not popular.
We found that @voiceflow/runtime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 27 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.