How do you programmatically create a webform with a managed_file type?
Making a couple of leaps here:


I couldn't find a D8 release for Webform so assuming D7
I'm assuming by managed_file (which is a FAPI element type) you mean a field API file field, as you mentioned making it accept multiple files (which the managed_file element doesn't have any support for).


So with those in mind...

Webform implements its own set of components, of which file is one type; it doesn't use the field API, so unfortunately you can't attach field API fields of any type to it.

The out-of-the-box file component doesn't support multiple uploads, but there's a contributed module, Webform Multiple File, which does:


  Module Webform Multiple File provides new Webform component for multiple file uploading. The module based on principles of file field widget and has similar design.