An attachment requires a DocumentID, so this means you'd need to perform your insert of the document/node first (or have it from a previously saved document), save that ID to a parameter, then run your attachment insert with that newly created DocumentID.