Lgcodegen Graph Spec

LangChain Hub prompt: johannes/lgcodegen-graph-spec

P
prompthub_co
·May 3, 2026·
141 0 11
$5.99
Prompt
225 words

Let me describe the pseudocode shown below, for specifying a langgraph graph we can run.

  • Comment lines begin with '#'.

  • The first word in the first non-comment line is the name of a State class. The State class holds information needed during the graph execution.

For example:

# description of node_1 behavior
node_1 -> node_2

These lines are the specification for node_1.

In some cases, node_1 might need to choose its destination

# node_1 might go to either node_2 or node_3
node_1 -> router_function(node_2, node_3)

The router function is similar to the Node function in that it takes the State as a parameter. It differs in the return value: the router function returns a string, the name of the node function to route to.

  • In all other non-comment lines, the first word in the line (excluding lines that start with white space) is the name of a Node function. The Node function takes the State class as a parameter.

The fields stored in State are based on what the nodes do.

Everything we ask for, any sort of user input, we save in the State, in either a field or a list. Every response that is generated, we also save in the State.

The text in the pseudocode are function names, there are no state fields named.

{question}

How to Use

Use with LangChain: hub.pull("johannes/lgcodegen-graph-spec")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Coding & Development

View All
Coding & Development
Universal

This Prompt Ads Sequential Function Calling To Models Other Than GPT 0613

This prompt ads sequential function calling to models other than GPT-0613

D
digitalmuse$2.99
39,910 89,588
Coding & Development
Universal

Create a personalized workout routine

Tailor a workout routine specifically designed for individual fitness goals

P
primequery$2.99
23,370 23,405
Coding & Development
Universal

GODMODE CHEATCODE

God Writes You a Letter Today. This is will help you find the perfect Bible Scripture that will guide you through a current problem you're facing.

S
signalcraft$3.99
13,574 13,622
Coding & Development
Universal

Creating a Personal Finance Tracker with [Technology/Tool]

Learn to create a personal finance tracker using [Technology/Tool]. Get code samples and budgeting tips.

F
focusqueryFree
376 385
Coding & Development
ChatGPT

Build an entire application using bubble.io with ChatGPT4

Build an entire app with bubble.io, assisted by chatGPT4, that knows bubble very well and is accurate 95% of the time. This prompt will help you maximize the quality of chatGPT assistance. Having detailed and step-by-step instructions is essential to progress fast with Bubble. This initial prompt will help you get started on a good basis. Follow it because I will make it even better.

P
promptframes$5.99
1,280 1,300
Coding & Development
Universal

Become LawyerGPT

Are you in a legal bind? This prompt can help you gain knowledge about how to handle your legal proceedings. DISCLAIMER: Please meet with a real lawyer to discuss your options.

P
promptbench$2.99
1,063 1,076