$ cat node-template.py
Custom Code
// A programmable node with custom Python code. Use when no existing template fits the requirement. The AI agent will generate appropriate code, input schemas, and output schemas based on your instructions.
Process
Utility
template.py
1import json2import sys345def main():6 """Custom Code node — code will be generated by the AI agent."""7 try:8 raw = json.loads(sys.stdin.read())9 inputs = raw.get("inputs", {})1011 print(json.dumps({12 "error": "No code generated yet. The AI agent will generate code for this node.",13 }), file=sys.stderr)14 sys.exit(1)1516 except Exception as e:17 print(json.dumps({18 "error": str(e),19 "errorType": type(e).__name__,20 }), file=sys.stderr)21 sys.exit(1)222324if __name__ == "__main__":25 main()