Skip to content

Workflow Builder

Workflows are fixed, deterministic pipelines — unlike Agents (dynamic ReAct loops). Use workflows for batch processing, ETL, or when you need predictable, repeatable steps.

import { Schift } from "@schift-io/sdk";
const schift = new Schift({ apiKey: "sch_..." });
const workflow = await schift.workflows.create({ name: "My RAG Pipeline" });

Workflows are built from blocks connected by edges. Available block types:

TypeDescription
startEntry point
endExit point
retrieverSearch a vector store
rerankerRe-rank search results
llmCall an LLM
prompt_templateFormat a prompt
document_loaderLoad documents
chunkerSplit documents into chunks
embedderGenerate embeddings
web_searchSearch the web
code_executorRun custom code
conditionalBranch based on condition
loopRepeat a set of blocks
api_callCall an external API
import { workflowFromYaml, workflowToYaml } from "@schift-io/sdk";
// Import from YAML
const definition = workflowFromYaml(yamlString);
// Export to YAML
const yaml = workflowToYaml(definition);
const result = await schift.workflows.run(workflow.id, {
query: "What is vector search?",
});
console.log(result);

Register custom block types for specialized processing:

import { registerCustomNode, SDKBaseNode } from "@schift-io/sdk";
class MyNode extends SDKBaseNode {
async execute(input: unknown) {
// Custom logic
return { processed: true, data: input };
}
}
registerCustomNode("my_custom_node", MyNode);