Skip to content

armgit / dify

Public Imported from GitHub
0

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.

546 B
Raw Blame
import type { BlockEnum, ValueSelector } from '../types'
import { hasErrorHandleNode } from '.'

export const variableTransformer = (v: ValueSelector | string) => {
  if (typeof v === 'string') return v.replace(/^\{\{#|#\}\}$/g, '').split('.')

  return `{{#${v.join('.')}#}}`
}

export const normalizeWorkflowOutputName = (name?: string) => name?.trim() ?? ''

export const isExceptionVariable = (variable: string, nodeType?: BlockEnum) => {
  return (variable === 'error_message' || variable === 'error_type') && hasErrorHandleNode(nodeType)
}