Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
import type { CommonNodeType } from '@/app/components/workflow/types'
import { useCallback, useEffect, useRef } from 'react'
import { useNodeDataUpdate } from '../../../hooks/use-node-data-update'
const useNodeCrud = <T>(id: string, data: CommonNodeType<T>) => {
const { handleNodeDataUpdateWithSyncDraft } = useNodeDataUpdate()
const updateRef = useRef(handleNodeDataUpdateWithSyncDraft)
useEffect(() => {
updateRef.current = handleNodeDataUpdateWithSyncDraft
}, [handleNodeDataUpdateWithSyncDraft])
const setInputs = useCallback(
(newInputs: CommonNodeType<T>) => {
updateRef.current({
id,
data: newInputs,
})
},
[id],
)
return {
inputs: data,
setInputs,
}
}
export default useNodeCrud