flow-parallelization
simple-ai/flow-parallelizationFreeBlock
Agentic parallelization workflow.
Live preview
live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://simple-ai.dev/r/flow-parallelization.jsonSource
1"use client";23import {4 Background,5 Controls,6 type EdgeTypes,7 MiniMap,8 type NodeTypes,9 Panel,10 ReactFlow,11 ReactFlowProvider,12 useReactFlow,13} from "@xyflow/react";14import { type DragEvent, useEffect } from "react";15import { shallow } from "zustand/shallow";16import "@xyflow/react/dist/style.css";17import { Button } from "@/components/ui/button";18import { ErrorIndicator } from "@/registry/blocks/flow-parallelization/components/error-indicator";19import { NodesPanel } from "@/registry/blocks/flow-parallelization/components/nodes-panel";20import { EXAM_CREATOR_PARALLELIZATION_WORKFLOW } from "@/registry/blocks/flow-parallelization/lib/exam-creator-parallelization";21import { useWorkflow } from "@/registry/hooks/flow/use-workflow";22import type { FlowNode } from "@/registry/lib/flow/workflow";23import { GenerateTextNodeController } from "@/registry/ui/flow/generate-text-node-controller";24import { PromptCrafterNodeController } from "@/registry/ui/flow/prompt-crafter-node-controller";25import { StatusEdgeController } from "@/registry/ui/flow/status-edge-controller";26import { TextInputNodeController } from "@/registry/ui/flow/text-input-node-controller";27import { VisualizeTextNodeController } from "@/registry/ui/flow/visualize-text-node-controller";2829const nodeTypes: NodeTypes = {30 "generate-text": GenerateTextNodeController,31 "visualize-text": VisualizeTextNodeController,32 "text-input": TextInputNodeController,33 "prompt-crafter": PromptCrafterNodeController,34};3536const edgeTypes: EdgeTypes = {37 status: StatusEdgeController,38};3940export function Flow() {41 const store = useWorkflow(42 (store) => ({43 nodes: store.nodes,44 edges: store.edges,45 onNodesChange: store.onNodesChange,46 onEdgesChange: store.onEdgesChange,47 onConnect: store.onConnect,48 startExecution: store.startExecution,49 createNode: store.createNode,50 workflowExecutionState: store.workflowExecutionState,51 initializeWorkflow: store.initializeWorkflow,52 }),53 shallow,54 );5556 // biome-ignore lint/correctness/useExhaustiveDependencies: We want to initialize the workflow only once57 useEffect(() => {58 store.initializeWorkflow(59 EXAM_CREATOR_PARALLELIZATION_WORKFLOW.nodes,60 EXAM_CREATOR_PARALLELIZATION_WORKFLOW.edges,61 );62 }, []);6364 const { screenToFlowPosition } = useReactFlow();6566 const onDragOver = (event: DragEvent) => {67 event.preventDefault();68 event.dataTransfer.dropEffect = "move";69 };7071 const onDrop = (event: DragEvent) => {72 event.preventDefault();7374// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from simple-ai
All 77 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| app-01app-01 | simple-ai | Blocks | Free | 5 deps · 11 files | |
| app-02app-02 | simple-ai | Blocks | Free | 3 deps · 5 files | |
| app-03app-03 | simple-ai | Blocks | Free | 4 deps · 9 files | |
| chat-01chat-01 | simple-ai | Blocks | Free | 3 deps · 16 files | |
| chat-02chat-02 | simple-ai | Blocks | Free | 2 deps · 3 files | |
| chat-03chat-03 | simple-ai | Blocks | Free | 2 deps · 3 files | |
| chat-04chat-04 | simple-ai | Blocks | Free | 3 deps · 13 files | |
| flow-chainflow-chain | simple-ai | Blocks | Free | 8 deps · 19 files |
