Prompt Builder
Ground a prompt template in curated context instead of raw merge fields. The four actions are ordinary Apex actions, so Prompt Builder can add one as a resource — no flow, no class to write. The template gets the same payload an agent gets, and it follows the entity when you change it.
Add the action as a resource
- Setup → Prompt Builder. Open your template, or click New Prompt Template and choose Flex. Add a resource for the record: set Source Type to Object and pick the object.
- In Resources, click + beside Actions and choose Apex.
- Pick the action. They’re in the Akoonu category, labeled ContextWorks: Get Records, Find Records, and Get Catalog — installed, they carry the
ctxlnamespace. - Fill in the inputs. Record IDs is usually the template’s record variable; Level, Format, Domain, and Entity are optional.
- Put the cursor where the context belongs in the prompt body and insert the action’s Result output.
- Preview against a real record to see the resolved prompt, then Activate.
Which action
| Action | Use for | Inputs that matter |
|---|---|---|
| Get Records | One record, or a few by ID | Record IDs, Level, Domain |
| Find Records | A set the template describes — this quarter’s open renewals | Object API Name, Filters, Sort By, Max Rows |
| Get Catalog | Rarely — it’s discovery, for agents that plan their own calls |
Full input reference: Invocable actions. Filter syntax: Query filters.
Notes
- Leave Format as markdown. It reads as prose to the model. Use
jsononly when something downstream parses the output. - Match the Level to the job.
detailedis the default; drop tostandardorlistwhen the prompt covers several records, or when context crowds out your instructions. - Set Domain, not Entity, for a mix of objects. Each record is read through that domain’s view for its own object.
- The template resolves as the user who runs it, so security applies unchanged — two users can get different context from one template.
- A failed call returns
Success = falseand an Error Message rather than throwing, so the template still renders. Check Preview if a section comes back empty.
Need an address the inputs don’t express? A scoped tool is a plain invocable action too — it appears in the same picker, with the domain and level already pinned.