Build a dynamic prompt
This tutorial shows how to build a prompt from earlier workflow values instead of writing one fixed prompt for every run.What you will build
The workflow will:- Define task instructions.
- Collect a document type from the user.
- Insert that value into a prompt.
- Ask an AI model to produce a structured outline.
- Return the result.
1. Define the instructions
Add a Text block containing the stable instructions:2. Collect a value
Add a User Input block and ask:documentType.
3. Assemble the dynamic prompt
Add another Text block with interpolation:instructions and the User Input output to documentType.
4. Generate the result
Add an Ask AI block and connect the assembled text to its prompt input. Choose an approved model and connect the response to a Flow Output block namedoutline.
5. Test the workflow
Run the workflow with:- A common document type
- A vague value
- An empty value
- A value containing punctuation or long text
Design guidance
- Keep instructions separate from variable values.
- Use descriptive interpolation names.
- Validate required input before generation.
- Avoid placing secrets or credentials in prompts.
- Return structured output when later steps need to process the result.