Step 3: Pantry Check
Read available ingredients from a file.
Goal
Generate recipes using only ingredients listed in your pantry file.
Setup
Create pantry.txt:
Eggs (12)Milk (1 gallon)Bread (1 loaf)Butter (1 lb)Chicken breast (2 lbs)Rice (2 lbs)Broccoli (1 bunch)Onions (3)Garlic (1 head)Olive oilSaltPepperThe Workflow
Update recipe.yaml:
# yaml-language-server: $schema=../../schemas/workflow.schema.jsonname: pantry-checkdescription: Generate meals using available pantry ingredients
inputs: - name: pantry_file type: string default: "pantry.txt" description: Path to pantry inventory file
- name: diet type: string description: Dietary preference
steps: - id: read_pantry name: Read Pantry Inventory file.read: "{{.inputs.pantry_file}}"
- id: meals name: Generate Meals type: parallel max_concurrency: 3 steps: - id: breakfast name: Generate Breakfast type: llm model: fast prompt: | Available ingredients: {{.steps.read_pantry.content}}
Generate a {{.inputs.diet}} breakfast using only these ingredients. Include the recipe name, ingredients with quantities, and cooking steps.
- id: lunch name: Generate Lunch type: llm model: fast prompt: | Available ingredients: {{.steps.read_pantry.content}}
Generate a {{.inputs.diet}} lunch using only these ingredients. Include the recipe name, ingredients with quantities, and cooking steps.
- id: dinner name: Generate Dinner type: llm model: fast prompt: | Available ingredients: {{.steps.read_pantry.content}}
Generate a {{.inputs.diet}} dinner using only these ingredients. Include the recipe name, ingredients with quantities, and cooking steps.
outputs: - name: breakfast type: string value: "{{.steps.meals.breakfast.response}}" description: Breakfast recipe format: markdown
- name: lunch type: string value: "{{.steps.meals.lunch.response}}" description: Lunch recipe format: markdown
- name: dinner type: string value: "{{.steps.meals.dinner.response}}" description: Dinner recipe format: markdownRun It
conductor run recipe.yamlRecipes will only use ingredients from your pantry file.
What You Learned
- Actions - Use
file.read:shorthand for file operations - File content - Access with
{{.steps.id.content}} - Dynamic prompts - Inject file contents into LLM prompts
Next
Step 4: Weekly Plan - Generate a full week of meals with variety checking.