Programmatic list of Webform elements?
By trawling through the code, I found this handy function in the Entity code, and it works perfectly:

 $elements = $webform-&gt;getElementsDecodedAndFlattened();


This gives a nice array of the elements in the webform itself.

If you want the results of a submission, grab that entity and use:

$data = $entity-&gt;getData();


I hope this helps