Skip to content

Conversation

@josephjclark
Copy link
Collaborator

@josephjclark josephjclark commented Dec 27, 2025

No more do users need to add a collections adaptor to workflow.yaml!

Now the CLI, just like the worker, will detect calls to the collections API and configure the workflow and configuratoin to allow collections to Just Work ™️

Fixes #841

UX

You can now execute an expression or workflow like this:

 openfn tmp/collections.js -a common --collections-endpoint https://app.staging.openfn.org --api-key $OPENFN_API_KEY

You can use OPENFN_API_KEY to set your PAT (note that the collections command itself is a bit inconsistent with this!), including using an env.

Still To Do

This basically works but I'd still like to look at:

  • integration tests with the CLI. A little harder to set up because of how collections works. I notice also we have no integration tests on openfn collections. Not sure how much I want to do about this - I might just roll with it, but it's got to be worth half an hour's time to try and set it up
  • No integration or testing with Project. Obviously execute-from-project isn't ready yet and can build on top of this. I'm not sure what, if anything, Project needs to do to support collections yet.
  • I need to raise a PR against docs with updates. This is a significant simplification.

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

@josephjclark josephjclark changed the base branch from main to release/next December 27, 2025 20:14
@github-project-automation github-project-automation bot moved this to New Issues in v2 Dec 27, 2025
},
ensure: (opts: any) => {
if (!opts.apikey) {
opts.apiKey = process.env.OPENFN_API_KEY;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO I should really set a helper in the CLI for this - just pass the env var name. Also need to apply this to other options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Collections: better support for executing workflows

2 participants