Workflow Builder
Overview
Section titled “Overview”Workflows are fixed, deterministic pipelines — unlike Agents (dynamic ReAct loops). Use workflows for batch processing, ETL, or when you need predictable, repeatable steps.
Creating a Workflow
Section titled “Creating a Workflow”import { Schift } from "@schift-io/sdk";
const schift = new Schift({ apiKey: "sch_..." });const workflow = await schift.workflows.create({ name: "My RAG Pipeline" });Block Types
Section titled “Block Types”Workflows are built from blocks connected by edges. Available block types:
| Type | Description |
|---|---|
start | Entry point |
end | Exit point |
retriever | Search a vector store |
reranker | Re-rank search results |
llm | Call an LLM |
prompt_template | Format a prompt |
document_loader | Load documents |
chunker | Split documents into chunks |
embedder | Generate embeddings |
web_search | Search the web |
code_executor | Run custom code |
conditional | Branch based on condition |
loop | Repeat a set of blocks |
api_call | Call an external API |
YAML Import/Export
Section titled “YAML Import/Export”import { workflowFromYaml, workflowToYaml } from "@schift-io/sdk";
// Import from YAMLconst definition = workflowFromYaml(yamlString);
// Export to YAMLconst yaml = workflowToYaml(definition);Running a Workflow
Section titled “Running a Workflow”const result = await schift.workflows.run(workflow.id, { query: "What is vector search?",});
console.log(result);Custom Nodes
Section titled “Custom Nodes”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);