Skip to main content
AI Generated Content
πŸ€– This documentation was generated with AI assistance. Please report any issues you find.

Node Metadata

Node metadata lets you annotate your functions with visual information β€” display names, categories, and node types β€” so they can be rendered as graph nodes in the Console and used in graph workflows.

Overview​

A node is a function with extra metadata that describes how it should appear in a visual graph:

import { pikkuSessionlessFunc } from '#pikku'

export const sendEmail = pikkuSessionlessFunc<
{ to: string; subject: string; body: string },
{ messageId: string }
>({
func: async ({ emailService }, data) => {
return await emailService.send(data)
},
title: 'Send email',
description: 'Sends an email via the configured email service',
tags: ['email', 'notifications'],
node: {
displayName: 'Send Email',
category: 'notifications',
type: 'action',
}
})

CoreNodeConfig​

The node property on a function definition accepts a CoreNodeConfig:

PropertyTypeDescription
displayNamestringHuman-readable name shown in the graph UI
categorystringGrouping category (e.g., 'email', 'database', 'payment')
typeNodeTypeVisual behavior: 'trigger', 'action', or 'end'
errorOutputbooleanWhether the node has an error output port (default: false)

NodeType​

TypeDescriptionUse For
'trigger'Entry point that starts a workflowEvent sources, webhook receivers, form submissions
'action'Processes data and passes it alongBusiness logic, API calls, transformations
'end'Terminal node that completes a branchFinal responses, notifications, cleanup

Node Categories​

Categories group related nodes in the Console UI. Configure allowed categories in pikku.config.json:

{
"console": {
"nodeCategories": ["notifications", "database", "payment", "auth", "utility"]
}
}

The Pikku CLI validates that all node categories in your code match the configured list. Unrecognized categories produce a build error.

NodeMeta​

When the CLI processes your code, it generates NodeMeta objects that combine the CoreNodeConfig with function metadata:

PropertyTypeSource
namestringFunction name
displayNamestringFrom node.displayName
categorystringFrom node.category
typeNodeTypeFrom node.type
rpcstringRPC name for invoking the function
descriptionstringFrom function description
errorOutputbooleanFrom node.errorOutput
inputSchemaNamestring | nullSchema name for the input type
outputSchemaNamestring | nullSchema name for the output type
tagsstring[]From function tags

Generating Node Metadata​

The CLI generates node metadata files automatically:

npx pikku

This produces JSON files in the .pikku/ output directory that the Console reads to render the graph UI.

Use Cases​

  • Graph workflow builder β€” Nodes appear as draggable elements in the Console's graph editor, categorized by type
  • Function discovery β€” The category and type annotations make it easier to browse large function registries
  • Addons β€” Published Pikku addons can include node metadata so their functions appear correctly in the consumer's Console